var/cache/test/twig/a2/a24b0549bd5aac77f7c6dbb225cef2b9.php line 431

Open in your IDE?
  1. <?php
  2. use Twig\Environment;
  3. use Twig\Error\LoaderError;
  4. use Twig\Error\RuntimeError;
  5. use Twig\Extension\SandboxExtension;
  6. use Twig\Markup;
  7. use Twig\Sandbox\SecurityError;
  8. use Twig\Sandbox\SecurityNotAllowedTagError;
  9. use Twig\Sandbox\SecurityNotAllowedFilterError;
  10. use Twig\Sandbox\SecurityNotAllowedFunctionError;
  11. use Twig\Source;
  12. use Twig\Template;
  13. /* @ui/dashboards/default/scripts.html.twig */
  14. class __TwigTemplate_a85876e443d18dc02ca692ee0cf6e27e extends \Twig\Template
  15. {
  16.     private $source;
  17.     private $macros = [];
  18.     public function __construct(Environment $env)
  19.     {
  20.         parent::__construct($env);
  21.         $this->source $this->getSourceContext();
  22.         $this->parent false;
  23.         $this->blocks = [
  24.         ];
  25.     }
  26.     protected function doDisplay(array $context, array $blocks = [])
  27.     {
  28.         $macros $this->macros;
  29.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  30.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""@ui/dashboards/default/scripts.html.twig"));
  31.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  32.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""@ui/dashboards/default/scripts.html.twig"));
  33.         // line 1
  34.         echo $this->extensions['Cms\CoreBundle\Service\Twig\ContextExtension']->embedScript($this->extensions['Cms\AssetsBundle\Service\AssetsTwigExtension']->assett("html5shiv::/dist/html5shiv.js"), nullnull"ie");
  35.         echo "
  36. ";
  37.         // line 2
  38.         echo $this->extensions['Cms\CoreBundle\Service\Twig\ContextExtension']->embedScript($this->extensions['Cms\AssetsBundle\Service\AssetsTwigExtension']->assett("respond::/dest/respond.js"), nullnull"ie");
  39.         echo "
  40. ";
  41.         // line 4
  42.         echo $this->extensions['Cms\CoreBundle\Service\Twig\ContextExtension']->embedScript($this->extensions['Cms\AssetsBundle\Service\AssetsTwigExtension']->assett("sugar::/release/sugar.min.js"), nullnull"head");
  43.         echo "
  44. ";
  45.         // line 5
  46.         echo $this->extensions['Cms\CoreBundle\Service\Twig\ContextExtension']->embedScript($this->extensions['Cms\AssetsBundle\Service\AssetsTwigExtension']->assett("headjs::/dist/1.0.0/head.min.js"), nullnull"head");
  47.         echo "
  48. ";
  49.         // line 6
  50.         echo $this->extensions['Cms\CoreBundle\Service\Twig\ContextExtension']->embedScript($this->extensions['Cms\AssetsBundle\Service\AssetsTwigExtension']->assett("jquery2::/dist/jquery.min.js"), nullnull"head");
  51.         echo "
  52. ";
  53.         // line 7
  54.         echo $this->extensions['Cms\CoreBundle\Service\Twig\ContextExtension']->embedScript($this->extensions['Cms\AssetsBundle\Service\AssetsTwigExtension']->assett("jquery-migrate::/dist/jquery-migrate.min.js"), nullnull"head");
  55.         echo "
  56. ";
  57.         // line 8
  58.         echo $this->extensions['Cms\CoreBundle\Service\Twig\ContextExtension']->embedScript($this->extensions['Cms\AssetsBundle\Service\AssetsTwigExtension']->assett("jquery-ui::/jquery-ui.min.js"), nullnull"head");
  59.         echo "
  60. ";
  61.         // line 9
  62.         echo $this->extensions['Cms\CoreBundle\Service\Twig\ContextExtension']->embedScript($this->extensions['Cms\AssetsBundle\Service\AssetsTwigExtension']->assett("bootstrap::/dist/js/bootstrap.min.js"), nullnull"head");
  63.         echo "
  64. ";
  65.         // line 10
  66.         echo $this->extensions['Cms\CoreBundle\Service\Twig\ContextExtension']->embedScript($this->extensions['Cms\AssetsBundle\Service\AssetsTwigExtension']->assett("jquery-cookie""jquery.cookie.min.js"), nullnull"bottom");
  67.         echo "
  68. ";
  69.         // line 12
  70.         echo $this->extensions['Cms\CoreBundle\Service\Twig\ContextExtension']->embedScript($this->extensions['Cms\AssetsBundle\Service\AssetsTwigExtension']->assett("breakpoints::/breakpoints.js"), nullnull"bottom");
  71.         echo "
  72. ";
  73.         // line 13
  74.         echo $this->extensions['Cms\CoreBundle\Service\Twig\ContextExtension']->embedScript($this->extensions['Cms\AssetsBundle\Service\AssetsTwigExtension']->assett("jquery-scrollbar::/jquery.scrollbar.min.js"), nullnull"bottom");
  75.         echo "
  76. ";
  77.         // line 14
  78.         echo $this->extensions['Cms\CoreBundle\Service\Twig\ContextExtension']->embedScript($this->extensions['Cms\AssetsBundle\Service\AssetsTwigExtension']->assett("jquery-slimscroll::/jquery.slimscroll.min.js"), nullnull"bottom");
  79.         echo "
  80. ";
  81.         // line 15
  82.         echo $this->extensions['Cms\CoreBundle\Service\Twig\ContextExtension']->embedScript($this->extensions['Cms\AssetsBundle\Service\AssetsTwigExtension']->assett("bootstrap-colorpicker::/dist/js/bootstrap-colorpicker.min.js"), nullnull"bottom");
  83.         echo "
  84. ";
  85.         // line 16
  86.         echo $this->extensions['Cms\CoreBundle\Service\Twig\ContextExtension']->embedScript($this->extensions['Cms\AssetsBundle\Service\AssetsTwigExtension']->assett("moment::/min/moment.min.js"), nullnull"bottom");
  87.         echo "
  88. ";
  89.         // line 17
  90.         echo $this->extensions['Cms\CoreBundle\Service\Twig\ContextExtension']->embedScript($this->extensions['Cms\AssetsBundle\Service\AssetsTwigExtension']->assett("bootstrap-slider::/dist/bootstrap-slider.min.js"), nullnull"bottom");
  91.         echo "
  92. ";
  93.         // line 18
  94.         echo $this->extensions['Cms\CoreBundle\Service\Twig\ContextExtension']->embedScript($this->extensions['Cms\AssetsBundle\Service\AssetsTwigExtension']->assett("chosen::/chosen.jquery.min.js"), nullnull"bottom");
  95.         echo "
  96. ";
  97.         // line 19
  98.         echo $this->extensions['Cms\CoreBundle\Service\Twig\ContextExtension']->embedScript($this->extensions['Cms\AssetsBundle\Service\AssetsTwigExtension']->assett("jquery-maskedinput::/dist/jquery.maskedinput.min.js"), nullnull"bottom");
  99.         echo "
  100. ";
  101.         // line 20
  102.         echo $this->extensions['Cms\CoreBundle\Service\Twig\ContextExtension']->embedScript($this->extensions['Cms\AssetsBundle\Service\AssetsTwigExtension']->assett("jquery-tageditor::/jquery.tag-editor.min.js"), nullnull"bottom");
  103.         echo "
  104. ";
  105.         // line 21
  106.         echo $this->extensions['Cms\CoreBundle\Service\Twig\ContextExtension']->embedScript($this->extensions['Cms\AssetsBundle\Service\AssetsTwigExtension']->assett("mixitup::/build/jquery.mixitup.min.js"), nullnull"bottom");
  107.         echo "
  108. ";
  109.         // line 22
  110.         echo $this->extensions['Cms\CoreBundle\Service\Twig\ContextExtension']->embedScript($this->extensions['Cms\AssetsBundle\Service\AssetsTwigExtension']->assett("knockout::/dist/knockout.js"), nullnull"bottom");
  111.         echo "
  112. ";
  113.         // line 23
  114.         echo $this->extensions['Cms\CoreBundle\Service\Twig\ContextExtension']->embedScript($this->extensions['Cms\AssetsBundle\Service\AssetsTwigExtension']->assett("chart-js::/dist/chart.min.js"), nullnull"bottom");
  115.         echo "
  116. ";
  117.         // line 24
  118.         echo $this->extensions['Cms\CoreBundle\Service\Twig\ContextExtension']->embedScript($this->extensions['Cms\AssetsBundle\Service\AssetsTwigExtension']->assett("palette-js::/palette.js"), nullnull"bottom");
  119.         echo "
  120. ";
  121.         // line 25
  122.         echo $this->extensions['Cms\CoreBundle\Service\Twig\ContextExtension']->embedScript($this->extensions['Cms\AssetsBundle\Service\AssetsTwigExtension']->assett("jquery-boilerplate::/dist/jquery.boilerplate.min.js"), nullnull"bottom");
  123.         echo "
  124. ";
  125.         // line 26
  126.         echo $this->extensions['Cms\CoreBundle\Service\Twig\ContextExtension']->embedScript($this->extensions['Cms\AssetsBundle\Service\AssetsTwigExtension']->assett("ace::/src-min-noconflict/ace.js"), nullnull"bottom");
  127.         echo "
  128. ";
  129.         // line 27
  130.         echo $this->extensions['Cms\CoreBundle\Service\Twig\ContextExtension']->embedScript($this->extensions['Cms\AssetsBundle\Service\AssetsTwigExtension']->assett("js-yaml::/dist/js-yaml.min.js"), nullnull"bottom");
  131.         echo "
  132. ";
  133.         // line 28
  134.         echo $this->extensions['Cms\CoreBundle\Service\Twig\ContextExtension']->embedScript($this->extensions['Cms\AssetsBundle\Service\AssetsTwigExtension']->assett("jquery-infinitescroll::/dist/infinite-scroll.pkgd.min.js"), nullnull"bottom");
  135.         echo "
  136. ";
  137.         // line 29
  138.         echo $this->extensions['Cms\CoreBundle\Service\Twig\ContextExtension']->embedScript($this->extensions['Cms\AssetsBundle\Service\AssetsTwigExtension']->assett("ckeditor::/ckeditor.js"), nullnull"bottom");
  139.         echo "
  140. ";
  141.         // line 30
  142.         echo $this->extensions['Cms\CoreBundle\Service\Twig\ContextExtension']->embedScript($this->extensions['Cms\AssetsBundle\Service\AssetsTwigExtension']->assett("uri-js::/src/URI.min.js"), nullnull"bottom");
  143.         echo "
  144. ";
  145.         // line 31
  146.         echo $this->extensions['Cms\CoreBundle\Service\Twig\ContextExtension']->embedScript("/bundles/cmscore/plugins/modal.js"nullnull"bottom");
  147.         echo "
  148. ";
  149.         // line 32
  150.         echo $this->extensions['Cms\CoreBundle\Service\Twig\ContextExtension']->embedScript($this->extensions['Cms\AssetsBundle\Service\AssetsTwigExtension']->assett("match-height::/dist/jquery.matchHeight-min.js"), nullnull"bottom");
  151.         echo "
  152. ";
  153.         // line 33
  154.         echo $this->extensions['Cms\CoreBundle\Service\Twig\ContextExtension']->embedScript($this->extensions['Cms\AssetsBundle\Service\AssetsTwigExtension']->assett("clipboardjs::/dist/clipboard.js"), nullnull"bottom");
  155.         echo "
  156. ";
  157.         // line 34
  158.         echo $this->extensions['Cms\CoreBundle\Service\Twig\ContextExtension']->embedScript($this->extensions['Cms\AssetsBundle\Service\AssetsTwigExtension']->assett("anchorme::/dist-browser/anchorme.min.js"), nullnull"bottom");
  159.         echo "
  160. ";
  161.         // line 35
  162.         echo $this->extensions['Cms\CoreBundle\Service\Twig\ContextExtension']->embedScript("/bundles/cmscore/searches.js"nullnull"bottom");
  163.         echo "
  164. ";
  165.         // line 36
  166.         echo $this->extensions['Cms\CoreBundle\Service\Twig\ContextExtension']->embedScript("/bundles/cmscore/dashboard/bulk.js"nullnull"bottom");
  167.         echo "
  168. ";
  169.         // line 39
  170.         echo $this->extensions['Cms\CoreBundle\Service\Twig\ContextExtension']->embedScript($this->extensions['Cms\AssetsBundle\Service\AssetsTwigExtension']->assett("cropper::/dist/cropper.min.js"));
  171.         echo "
  172. ";
  173.         // line 40
  174.         echo $this->extensions['Cms\CoreBundle\Service\Twig\ContextExtension']->embedStyle($this->extensions['Cms\AssetsBundle\Service\AssetsTwigExtension']->assett("cropper::/dist/cropper.min.css"));
  175.         echo "
  176. ";
  177.         // line 41
  178.         echo $this->extensions['Cms\CoreBundle\Service\Twig\ContextExtension']->embedScript("/bundles/cmsfile/cropper.js"nullnull"bottom");
  179.         echo "
  180. ";
  181.         // line 44
  182.         echo $this->extensions['Cms\CoreBundle\Service\Twig\ContextExtension']->embedScript($this->extensions['Cms\AssetsBundle\Service\AssetsTwigExtension']->assett("toastr::/toastr.min.js"), nullnull"bottom");
  183.         echo "
  184. ";
  185.         // line 45
  186.         echo $this->extensions['Cms\CoreBundle\Service\Twig\ContextExtension']->embedStyle($this->extensions['Cms\AssetsBundle\Service\AssetsTwigExtension']->assett("toastr::/toastr.min.css"));
  187.         echo "
  188. ";
  189.         // line 46
  190.         ob_start();
  191.         // line 47
  192.         echo "    <script>
  193.         (function (window, document, \$, undefined) {
  194.             \$(function () {
  195.                 toastr.options = {
  196.                     closeButton: false,
  197.                     debug: false,
  198.                     newestOnTop: true,
  199.                     progressBar: false,
  200.                     positionClass: 'toast-top-right',
  201.                     preventDuplicates: false,
  202.                     onclick: null,
  203.                     showDuration: '250',
  204.                     hideDuration: '250',
  205.                     timeOut: '1500',
  206.                     extendedTimeOut: '500',
  207.                     showEasing: 'swing',
  208.                     hideEasing: 'linear',
  209.                     showMethod: 'fadeIn',
  210.                     hideMethod: 'fadeOut'
  211.                 };
  212.             });
  213.         })(window, document, jQuery);
  214.     </script>
  215. ";
  216.         $context['renderer']->currentScene()->getAssetsOrganizer()->getScripts()->add(new Cms\AssetsBundle\Model\Structure\ScriptStructure\InlineScriptStructure(trim(preg_replace(array('/^<script>/''/<\/script>$/'), ''trim(ob_get_clean()))), "text/javascript"), null"bottom");
  217.         // line 71
  218.         echo "
  219. ";
  220.         // line 73
  221.         ob_start();
  222.         // line 74
  223.         echo "    <script>
  224.         function htmlEscape(str) {
  225.             return String(str)
  226.                 .replace(/&/g, '&amp;')
  227.                 .replace(/\"/g, '&quot;')
  228.                 .replace(/'/g, '&#39;')
  229.                 .replace(/</g, '&lt;')
  230.                 .replace(/>/g, '&gt;');
  231.         }
  232.         \$.fn.serializeObject = function() {
  233.             var o = {}, a = this.serializeArray();
  234.             \$.each(a, function() {
  235.                 if (o[this.name] !== undefined) {
  236.                     if (!o[this.name].push) {
  237.                         o[this.name] = [o[this.name]];
  238.                     }
  239.                     o[this.name].push(this.value || '');
  240.                 } else {
  241.                     o[this.name] = this.value || '';
  242.                 }
  243.             });
  244.             return o;
  245.         };
  246.     </script>
  247. ";
  248.         $context['renderer']->currentScene()->getAssetsOrganizer()->getScripts()->add(new Cms\AssetsBundle\Model\Structure\ScriptStructure\InlineScriptStructure(trim(preg_replace(array('/^<script>/''/<\/script>$/'), ''trim(ob_get_clean()))), "text/javascript"), null"bottom");
  249.         // line 99
  250.         echo "
  251. ";
  252.         // line 100
  253.         ob_start();
  254.         // line 101
  255.         echo "    <script>
  256.         (function (window, document, \$, undefined) {
  257.             // hide modal content when hidden
  258.             \$('body').on('hidden.bs.modal', '[data-campussuite-modal-autoempty]', function (e) {
  259.                 var \$target = \$(e.target),
  260.                     \$content = \$target.find('div.modal-content').first();
  261.                 \$content.empty();
  262.             });
  263.             // image loader plugin
  264.             window.csimgloader = function(elem, count) {
  265.                 // init count
  266.                 if (count === undefined) {
  267.                     count = 1;
  268.                 }
  269.                 // should be an img element
  270.                 var \$elem = \$(elem);
  271.                 // grab the src of the image
  272.                 var src = \$elem.attr('src');
  273.                 // set new html for loading purposes
  274.                 var \$parent = \$elem.parent();
  275.                 \$parent.html('<img alt=\"\" src=\"/bundles/cmscore/loading.gif\" />');
  276.                 // set a callback that runs in a few seconds to try and reload the image
  277.                 setTimeout((function(parent, src, count) {
  278.                     return function() {
  279.                         if (count > 12) {
  280.                             return;
  281.                         }
  282.                         count++;
  283.                         var \$parent = \$(parent);
  284.                         if (\$.contains(document.documentElement, \$parent[0])) {
  285.                             \$parent.html('<img alt=\"\" src=\"' + src + '\" onerror=\"(function(elem){jQuery(function() {window.csimgloader(elem, ' + count + ');});})(this);\" />');
  286.                         }
  287.                     };
  288.                 })(\$parent[0], src, count), 5000);
  289.             }
  290.         })(window, document, jQuery);
  291.     </script>
  292. ";
  293.         $context['renderer']->currentScene()->getAssetsOrganizer()->getScripts()->add(new Cms\AssetsBundle\Model\Structure\ScriptStructure\InlineScriptStructure(trim(preg_replace(array('/^<script>/''/<\/script>$/'), ''trim(ob_get_clean()))), "text/javascript"), null"bottom");
  294.         // line 146
  295.         echo "
  296. ";
  297.         // line 147
  298.         ob_start();
  299.         // line 148
  300.         echo "    <script>
  301.         CKEDITOR.dtd.\$removeEmpty['em'] = false;
  302.         CKEDITOR.on('dialogDefinition', function(e) {
  303.             var dialog = e.data;
  304.             var dialogName = dialog.name;
  305.             var dialogDefinition = dialog.definition;
  306.             if (dialogName === 'link') {
  307.                 var infoTab = dialogDefinition.getContents('info');
  308.                 var urlOptions = infoTab.get('urlOptions');
  309.                 urlOptions.children.push({
  310.                     type: 'button',
  311.                     id: 'browseSite',
  312.                     label: 'Browse Files',
  313.                     title: 'Browse Files',
  314.                     onClick: function() {
  315.                         var urlField = this.getDialog().getContentElement('info', 'url'),
  316.                             cs = window.top.CAMPUSSUITE;
  317.                         CampussuiteModals.open({
  318.                             url: '/_dashboard/files/modal',
  319.                             params: {
  320.                                 mode: (typeof CKEDITOR_MODAL_OVERRIDE !== 'undefined') ? CKEDITOR_MODAL_OVERRIDE : 'url',
  321.                                 container: cs.container,
  322.                                 value: urlField.getValue()
  323.                             },
  324.                             callback: function(selection) {
  325.                                 urlField.setValue(selection);
  326.                             },
  327.                             styles: 'modal-dialog--media'
  328.                         });
  329.                     }
  330.                 });
  331.                 urlOptions.children.push({
  332.                     type: 'button',
  333.                     id: 'browseContent',
  334.                     label: 'Browse Content',
  335.                     title: 'Browse Content',
  336.                     onClick: function() {
  337.                         var urlField = this.getDialog().getContentElement('info', 'url'),
  338.                             cs = window.top.CAMPUSSUITE;
  339.                         CampussuiteModals.open({
  340.                             url: '/_dashboard/modules/modal',
  341.                             params: {
  342.                                 containerId: cs.container
  343.                             },
  344.                             callback: function(selection) {
  345.                                 urlField.setValue(selection);
  346.                             },
  347.                             styles: 'modal-dialog--media'
  348.                         });
  349.                     }
  350.                 });
  351.             }
  352.             if (dialogName === 'image') {
  353.                 var tb = dialogDefinition.getContents('info');
  354.                 var thing = tb.elements[0].children[0];
  355.                 thing.children.push({
  356.                     type: 'button',
  357.                     id: 'browseSite',
  358.                     label: 'Browse Files',
  359.                     title: 'Browse Files',
  360.                     onClick: function() {
  361.                         var urlField = this.getDialog().getContentElement('info', 'txtUrl'),
  362.                             cs = window.top.CAMPUSSUITE;
  363.                         CampussuiteModals.open({
  364.                             url: '/_dashboard/files/modal',
  365.                             params: {
  366.                                 mode: (typeof CKEDITOR_MODAL_OVERRIDE !== 'undefined') ? CKEDITOR_MODAL_OVERRIDE : 'url',
  367.                                 container: cs.container,
  368.                                 value: urlField.getValue()
  369.                             },
  370.                             callback: function(selection) {
  371.                                 urlField.setValue(selection);
  372.                             },
  373.                             styles: 'modal-dialog--media'
  374.                         });
  375.                     }
  376.                 });
  377.             }
  378.         });
  379.     </script>
  380. ";
  381.         $context['renderer']->currentScene()->getAssetsOrganizer()->getScripts()->add(new Cms\AssetsBundle\Model\Structure\ScriptStructure\InlineScriptStructure(trim(preg_replace(array('/^<script>/''/<\/script>$/'), ''trim(ob_get_clean()))), "text/javascript"), null"bottom");
  382.         // line 229
  383.         echo "
  384. ";
  385.         // line 230
  386.         echo $this->extensions['Cms\CoreBundle\Service\Twig\ContextExtension']->embedScript("/bundles/cmscore/AjaxSelect.js"nullnull"bottom");
  387.         echo "
  388. <script type=\"text/javascript\">
  389.     window.CAMPUSSUITE = {
  390.         environment: '";
  391.         // line 234
  392.         echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->source, (isset($context["cms"]) || array_key_exists("cms"$context) ? $context["cms"] : (function () { throw new RuntimeError('Variable "cms" does not exist.'234$this->source); })()), "environment", [], "any"falsefalsefalse234), "html"nulltrue);
  393.         echo "',
  394.         tenant: {
  395.             id: ";
  396.         // line 236
  397.         echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["cms"]) || array_key_exists("cms"$context) ? $context["cms"] : (function () { throw new RuntimeError('Variable "cms" does not exist.'236$this->source); })()), "tenant", [], "any"falsefalsefalse236), "id", [], "any"falsefalsefalse236), "html"nulltrue);
  398.         echo ",
  399.             uid: '";
  400.         // line 237
  401.         echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["cms"]) || array_key_exists("cms"$context) ? $context["cms"] : (function () { throw new RuntimeError('Variable "cms" does not exist.'237$this->source); })()), "tenant", [], "any"falsefalsefalse237), "uid", [], "any"falsefalsefalse237), "toString", [], "method"falsefalsefalse237), "html"nulltrue);
  402.         echo "',
  403.             slug: '";
  404.         // line 238
  405.         echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["cms"]) || array_key_exists("cms"$context) ? $context["cms"] : (function () { throw new RuntimeError('Variable "cms" does not exist.'238$this->source); })()), "tenant", [], "any"falsefalsefalse238), "slug", [], "any"falsefalsefalse238), "html"nulltrue);
  406.         echo "'
  407.         },
  408.         container: ";
  409.         // line 240
  410.         (( !twig_test_empty(twig_get_attribute($this->env$this->source, (isset($context["cms"]) || array_key_exists("cms"$context) ? $context["cms"] : (function () { throw new RuntimeError('Variable "cms" does not exist.'240$this->source); })()), "department", [], "any"falsefalsefalse240))) ? (print (twig_escape_filter($this->envtwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["cms"]) || array_key_exists("cms"$context) ? $context["cms"] : (function () { throw new RuntimeError('Variable "cms" does not exist.'240$this->source); })()), "department", [], "any"falsefalsefalse240), "id", [], "any"falsefalsefalse240), "html"nulltrue))) : (print ("null")));
  411.         echo "
  412.     };
  413. </script>
  414. ";
  415.         // line 244
  416.         ob_start();
  417.         // line 245
  418.         echo "    <script>
  419.         // Break point entry
  420.         \$(function() {
  421.             var \$window = \$(window),
  422.                 \$console = \$('#cs-console');
  423.             \$window
  424.                 .bind('enterBreakpoint321', function () {
  425.                     if (\$console.hasClass('sb-disable-autoload')) {
  426.                         return;
  427.                     }
  428.                     \$console
  429.                         .removeClass('cs-console-md')
  430.                         .removeClass('cs-console-lg sb-expand')
  431.                         .addClass('cs-console-sm sb-collapse');
  432.                 })
  433.                 .bind('enterBreakpoint481', function () {
  434.                     if (\$console.hasClass('sb-disable-autoload')) {
  435.                         return;
  436.                     }
  437.                     \$console
  438.                         .removeClass('cs-console-md')
  439.                         .removeClass('cs-console-lg sb-expand')
  440.                         .addClass('cs-console-sm sb-collapse');
  441.                 })
  442.                 .bind('enterBreakpoint821', function () {
  443.                     if (\$console.hasClass('sb-disable-autoload')) {
  444.                         return;
  445.                     }
  446.                     \$console
  447.                         .removeClass('cs-console-sm')
  448.                         .removeClass('cs-console-lg sb-expand')
  449.                         .addClass('cs-console-md sb-collapse');
  450.                 })
  451.                 .bind('enterBreakpoint1065', function () {
  452.                     if (\$console.hasClass('sb-disable-autoload')) {
  453.                         return;
  454.                     }
  455.                     \$console
  456.                         .removeClass('cs-console-sm sb-collapse')
  457.                         .removeClass('cs-console-md sb-collapse')
  458.                         .addClass('cs-console-lg sb-expand');
  459.                 });
  460.             \$window.setBreakpoints({
  461.                 distinct: true,
  462.                 breakpoints: [
  463.                     // needing to set breakpoints at one pixel above where they should
  464.                     // this better matches current css media queries
  465.                     // these events need triggered once the viewport extends beyond the designated \"real\" sizes, hence the extra pixel
  466.                     321,// 320
  467.                     481,// 480
  468.                     821,// 820
  469.                     1065// 1064
  470.                 ]
  471.             });
  472.         });
  473.         // Console Sidebar Toggle
  474.         \$(function() {
  475.             var \$toggle = \$('.cs-console-sb-toggle'),
  476.                 \$console = \$('#cs-console');
  477.             \$toggle.click(function () {
  478.                 if (\$console.hasClass('sb-collapse')) {
  479.                     \$console
  480.                         .removeClass('sb-collapse')
  481.                         .addClass('sb-expand');
  482.                 } else {
  483.                     \$console
  484.                         .removeClass('sb-expand')
  485.                         .addClass('sb-collapse');
  486.                 }
  487.             });
  488.         });
  489.         // Console Sidebar Hover
  490.         \$(function() {
  491.             var \$sidebar = \$('#cs-console-sidebar'),
  492.                 \$console = \$('#cs-console');
  493.             \$sidebar.hover(
  494.                 function () {
  495.                     //if ( ! \$console.hasClass('cs-console-sm')) {
  496.                     if (\$console.hasClass('cs-console-md')) {
  497.                         \$console
  498.                             .addClass('sb-expand')
  499.                             .removeClass('sb-collapse');
  500.                     }
  501.                 },
  502.                 function () {
  503.                     if (\$console.hasClass('cs-console-md')) {
  504.                         \$console
  505.                             .addClass('sb-collapse')
  506.                             .removeClass('sb-expand');
  507.                     }
  508.                 }
  509.             );
  510.         });
  511.         // Console Sidebar Nav Toggle
  512.         \$(function() {
  513.             \$('ul.editor__side-nav').on('click', 'a', function(e) {
  514.                 var \$link = \$(e.currentTarget),
  515.                     \$topmenu = \$link.closest('ul'),
  516.                     \$topitem = \$link.closest('li');
  517.                 // remove the active state from all current items
  518.                 // skip the currently selected item to prevent odd behavior
  519.                 \$topmenu
  520.                     .find('li')
  521.                     .not(\$topitem)
  522.                     .removeClass('active');
  523.                 // activate the current items
  524.                 \$topitem.addClass('active');
  525.             });
  526.             \$('ul.cs-console-sb-menu').on('click', 'a', function(e) {
  527.                 var \$link = \$(e.currentTarget),
  528.                     \$topmenu = \$link.closest('ul'),
  529.                     \$submenu = null,
  530.                     \$topitem = null,
  531.                     \$subitem = null;
  532.                 // fix the menus
  533.                 if (\$topmenu.hasClass('cs-sub-menu')) {
  534.                     \$submenu = \$topmenu;
  535.                     \$topmenu = \$submenu.closest('ul');
  536.                 }
  537.                 // if there is a submenu above, then there are two items to consider
  538.                 if (\$submenu !== null) {
  539.                     \$subitem = \$link.closest('li');
  540.                     \$topitem = \$subitem.closest('li');
  541.                 } else {
  542.                     \$topitem = \$link.closest('li');
  543.                 }
  544.                 // now, there might be a submenu related that we need to show
  545.                 // if nothing returns, clear out the variable
  546.                 \$submenu = \$topitem.children('ul.cs-sub-menu');
  547.                 if (\$submenu.length === 0) {
  548.                     \$submenu = null;
  549.                 }
  550.                 // remove the active state from all current items
  551.                 // skip the currently selected item to prevent odd behavior
  552.                 \$topmenu
  553.                     .find('li')
  554.                     .not(\$topitem)
  555.                     .not(\$subitem)
  556.                     .removeClass('active');
  557.                 // slide up all open submenus
  558.                 // skip the currently selected item to prevent odd behavior
  559.                 \$topmenu
  560.                     .find('ul.cs-sub-menu')
  561.                     .not(\$submenu)
  562.                     .slideUp(200);
  563.                 // activate the current items
  564.                 \$topitem.addClass('active');
  565.                 if (\$subitem !== null) {
  566.                     \$subitem.addClass('active');
  567.                 }
  568.                 // if we have a submenu, open it
  569.                 // items with submenus should not have other actions, prevent default then
  570.                 if (\$submenu !== null) {
  571.                     \$submenu.slideDown(200);
  572.                     e.preventDefault();
  573.                 }
  574.             });
  575.         });
  576.         // Console Sidebar Slimscroll
  577.         \$(function() {
  578.             var resizeListener;
  579.             var pause = 500;
  580.             \$('.sb-scroll').slimScroll({
  581.                 height: 'auto',
  582.                 size: '10px'
  583.             });
  584.             \$(window).resize(function(){
  585.                 clearTimeout(resizeListener);
  586.                 resizeListener = setTimeout(
  587.                     function() {
  588.                         \$('.sb-scroll').slimScroll({
  589.                             height: 'auto'
  590.                         });
  591.                     },
  592.                     pause
  593.                 );
  594.             });
  595.         });
  596.     </script>
  597. ";
  598.         $context['renderer']->currentScene()->getAssetsOrganizer()->getScripts()->add(new Cms\AssetsBundle\Model\Structure\ScriptStructure\InlineScriptStructure(trim(preg_replace(array('/^<script>/''/<\/script>$/'), ''trim(ob_get_clean()))), "text/javascript"), null"bottom");
  599.         // line 442
  600.         echo "
  601. ";
  602.         // line 443
  603.         ob_start();
  604.         // line 444
  605.         echo "    <script>
  606.         \$('[data-topbar=\"popover-bottom\"]').popover({
  607.             html: true,
  608.             placement: 'bottom',
  609.             sanitize: false,
  610.             content: function () {
  611.                 return \$(this).siblings('.dropdown-content').html();
  612.             }
  613.         });
  614.         // Close popovers
  615.         \$('body').on('click', function (e) {
  616.             \$('[data-topbar=\"popover-bottom\"]').each(function () {
  617.                 if (!\$(this).is(e.target) && \$(this).has(e.target).length === 0 && \$('.popover').has(e.target).length === 0) {
  618.                     \$(this).popover('hide');
  619.                 }
  620.             });
  621.         });
  622.         // tooltips: https://getbootstrap.com/docs/3.3/javascript/#tooltips-examples
  623.         \$(function () {
  624.             const elements = \$('[data-toggle=\"tooltip\"]');
  625.             for (let i=0; i < elements.length; i++) {
  626.                 const element = \$(elements[i]);
  627.                 const isTriggeredByClick = ('click' === element.data('trigger'));
  628.                 element.tooltip({
  629.                     container: 'body',
  630.                     placement: element.data('placement') ?? 'right',
  631.                     trigger: isTriggeredByClick ? 'manual' : 'hover',
  632.                     html: true,
  633.                     template: '<div class=\"tooltip tooltip-custom\" role=\"tooltip\"><div class=\"tooltip-arrow tooltip-arrow-custom\"></div><div class=\"tooltip-inner tooltip-inner-custom\"></div></div>',
  634.                 });
  635.                 if (isTriggeredByClick) {
  636.                     element.on('click', function (event) {
  637.                         event.preventDefault();
  638.                         event.stopPropagation();
  639.                         \$(this).tooltip('show');
  640.                     });
  641.                 }
  642.                 element.on('show.bs.tooltip', function () {
  643.                     const displayedTitle = \$(this).data('originalTitle');
  644.                     const tooltipElements = \$('[data-toggle=\"tooltip\"]');
  645.                     for (let i=0; i < tooltipElements.length; i++) {
  646.                         if (displayedTitle !== \$(tooltipElements[i]).data('originalTitle')) {
  647.                             \$(tooltipElements[i]).tooltip('hide');
  648.                         }
  649.                     }
  650.                 });
  651.             }
  652.             \$('body').on('click', function () {
  653.                 \$('[data-toggle=\"tooltip\"]').tooltip('hide');
  654.             });
  655.         });
  656.     </script>
  657. ";
  658.         $context['renderer']->currentScene()->getAssetsOrganizer()->getScripts()->add(new Cms\AssetsBundle\Model\Structure\ScriptStructure\InlineScriptStructure(trim(preg_replace(array('/^<script>/''/<\/script>$/'), ''trim(ob_get_clean()))), "text/javascript"), null"bottom");
  659.         // line 504
  660.         echo "
  661. ";
  662.         // line 505
  663.         $this->loadTemplate("@ui/dashboards/default/scripts/google-analytics.html.twig""@ui/dashboards/default/scripts.html.twig"505)->display(twig_array_merge($context, ['_args' => []]));
  664.         // line 506
  665.         $this->loadTemplate("@ui/dashboards/default/scripts/zendesk.html.twig""@ui/dashboards/default/scripts.html.twig"506)->display(twig_array_merge($context, ['_args' => []]));
  666.         // line 507
  667.         $this->loadTemplate("@ui/dashboards/default/scripts/churnzero.html.twig""@ui/dashboards/default/scripts.html.twig"507)->display(twig_array_merge($context, ['_args' => []]));
  668.         
  669.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  670.         
  671.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  672.     }
  673.     public function getTemplateName()
  674.     {
  675.         return "@ui/dashboards/default/scripts.html.twig";
  676.     }
  677.     public function isTraitable()
  678.     {
  679.         return false;
  680.     }
  681.     public function getDebugInfo()
  682.     {
  683.         return array (  713 => 507,  711 => 506,  709 => 505,  706 => 504,  644 => 444,  642 => 443,  639 => 442,  440 => 245,  438 => 244,  431 => 240,  426 => 238,  422 => 237,  418 => 236,  413 => 234,  406 => 230,  403 => 229,  320 => 148,  318 => 147,  315 => 146,  268 => 101,  266 => 100,  263 => 99,  236 => 74,  234 => 73,  231 => 71,  205 => 47,  203 => 46,  199 => 45,  195 => 44,  190 => 41,  186 => 40,  182 => 39,  177 => 36,  173 => 35,  169 => 34,  165 => 33,  161 => 32,  157 => 31,  153 => 30,  149 => 29,  145 => 28,  141 => 27,  137 => 26,  133 => 25,  129 => 24,  125 => 23,  121 => 22,  117 => 21,  113 => 20,  109 => 19,  105 => 18,  101 => 17,  97 => 16,  93 => 15,  89 => 14,  85 => 13,  81 => 12,  76 => 10,  72 => 9,  68 => 8,  64 => 7,  60 => 6,  56 => 5,  52 => 4,  47 => 2,  43 => 1,);
  684.     }
  685.     public function getSourceContext()
  686.     {
  687.         return new Source("{{ embed_script(assett('html5shiv::/dist/html5shiv.js'), null, null, 'ie') }}
  688. {{ embed_script(assett('respond::/dest/respond.js'), null, null, 'ie') }}
  689. {{ embed_script(assett('sugar::/release/sugar.min.js'), null, null, 'head') }}
  690. {{ embed_script(assett('headjs::/dist/1.0.0/head.min.js'), null, null, 'head') }}
  691. {{ embed_script(assett('jquery2::/dist/jquery.min.js'), null, null, 'head') }}
  692. {{ embed_script(assett('jquery-migrate::/dist/jquery-migrate.min.js'), null, null, 'head') }}
  693. {{ embed_script(assett('jquery-ui::/jquery-ui.min.js'), null, null, 'head') }}
  694. {{ embed_script(assett('bootstrap::/dist/js/bootstrap.min.js'), null, null, 'head') }}
  695. {{ embed_script(assett('jquery-cookie', 'jquery.cookie.min.js'), null, null, 'bottom') }}
  696. {{ embed_script(assett('breakpoints::/breakpoints.js'), null, null, 'bottom') }}
  697. {{ embed_script(assett('jquery-scrollbar::/jquery.scrollbar.min.js'), null, null, 'bottom') }}
  698. {{ embed_script(assett('jquery-slimscroll::/jquery.slimscroll.min.js'), null, null, 'bottom') }}
  699. {{ embed_script(assett('bootstrap-colorpicker::/dist/js/bootstrap-colorpicker.min.js'), null, null, 'bottom') }}
  700. {{ embed_script(assett('moment::/min/moment.min.js'), null, null, 'bottom') }}
  701. {{ embed_script(assett('bootstrap-slider::/dist/bootstrap-slider.min.js'), null, null, 'bottom') }}
  702. {{ embed_script(assett('chosen::/chosen.jquery.min.js'), null, null, 'bottom') }}
  703. {{ embed_script(assett('jquery-maskedinput::/dist/jquery.maskedinput.min.js'), null, null, 'bottom') }}
  704. {{ embed_script(assett('jquery-tageditor::/jquery.tag-editor.min.js'), null, null, 'bottom') }}
  705. {{ embed_script(assett('mixitup::/build/jquery.mixitup.min.js'), null, null, 'bottom') }}
  706. {{ embed_script(assett('knockout::/dist/knockout.js'), null, null, 'bottom') }}
  707. {{ embed_script(assett('chart-js::/dist/chart.min.js'), null, null, 'bottom') }}
  708. {{ embed_script(assett('palette-js::/palette.js'), null, null, 'bottom') }}
  709. {{ embed_script(assett('jquery-boilerplate::/dist/jquery.boilerplate.min.js'), null, null, 'bottom') }}
  710. {{ embed_script(assett('ace::/src-min-noconflict/ace.js'), null, null, 'bottom') }}
  711. {{ embed_script(assett('js-yaml::/dist/js-yaml.min.js'), null, null, 'bottom') }}
  712. {{ embed_script(assett('jquery-infinitescroll::/dist/infinite-scroll.pkgd.min.js'), null, null, 'bottom') }}
  713. {{ embed_script(assett('ckeditor::/ckeditor.js'), null, null, 'bottom') }}
  714. {{ embed_script(assett('uri-js::/src/URI.min.js'), null, null, 'bottom') }}
  715. {{ embed_script('/bundles/cmscore/plugins/modal.js', null, null, 'bottom') }}
  716. {{ embed_script(assett('match-height::/dist/jquery.matchHeight-min.js'), null, null, 'bottom') }}
  717. {{ embed_script(assett('clipboardjs::/dist/clipboard.js'), null, null, 'bottom') }}
  718. {{ embed_script(assett('anchorme::/dist-browser/anchorme.min.js'), null, null, 'bottom') }}
  719. {{ embed_script('/bundles/cmscore/searches.js', null, null, 'bottom') }}
  720. {{ embed_script('/bundles/cmscore/dashboard/bulk.js', null, null, 'bottom') }}
  721. {# HACK: cropper #}
  722. {{ embed_script(assett('cropper::/dist/cropper.min.js')) }}
  723. {{ embed_style(assett('cropper::/dist/cropper.min.css')) }}
  724. {{ embed_script('/bundles/cmsfile/cropper.js', null, null, 'bottom') }}
  725. {# HACK: toastr #}
  726. {{ embed_script(assett('toastr::/toastr.min.js'), null, null, 'bottom') }}
  727. {{ embed_style(assett('toastr::/toastr.min.css')) }}
  728. {% inline_script %}
  729.     <script>
  730.         (function (window, document, \$, undefined) {
  731.             \$(function () {
  732.                 toastr.options = {
  733.                     closeButton: false,
  734.                     debug: false,
  735.                     newestOnTop: true,
  736.                     progressBar: false,
  737.                     positionClass: 'toast-top-right',
  738.                     preventDuplicates: false,
  739.                     onclick: null,
  740.                     showDuration: '250',
  741.                     hideDuration: '250',
  742.                     timeOut: '1500',
  743.                     extendedTimeOut: '500',
  744.                     showEasing: 'swing',
  745.                     hideEasing: 'linear',
  746.                     showMethod: 'fadeIn',
  747.                     hideMethod: 'fadeOut'
  748.                 };
  749.             });
  750.         })(window, document, jQuery);
  751.     </script>
  752. {% endinline %}
  753. {# pulled from page editor stuff #}
  754. {% inline_script %}
  755.     <script>
  756.         function htmlEscape(str) {
  757.             return String(str)
  758.                 .replace(/&/g, '&amp;')
  759.                 .replace(/\"/g, '&quot;')
  760.                 .replace(/'/g, '&#39;')
  761.                 .replace(/</g, '&lt;')
  762.                 .replace(/>/g, '&gt;');
  763.         }
  764.         \$.fn.serializeObject = function() {
  765.             var o = {}, a = this.serializeArray();
  766.             \$.each(a, function() {
  767.                 if (o[this.name] !== undefined) {
  768.                     if (!o[this.name].push) {
  769.                         o[this.name] = [o[this.name]];
  770.                     }
  771.                     o[this.name].push(this.value || '');
  772.                 } else {
  773.                     o[this.name] = this.value || '';
  774.                 }
  775.             });
  776.             return o;
  777.         };
  778.     </script>
  779. {% endinline %}
  780. {% inline_script %}
  781.     <script>
  782.         (function (window, document, \$, undefined) {
  783.             // hide modal content when hidden
  784.             \$('body').on('hidden.bs.modal', '[data-campussuite-modal-autoempty]', function (e) {
  785.                 var \$target = \$(e.target),
  786.                     \$content = \$target.find('div.modal-content').first();
  787.                 \$content.empty();
  788.             });
  789.             // image loader plugin
  790.             window.csimgloader = function(elem, count) {
  791.                 // init count
  792.                 if (count === undefined) {
  793.                     count = 1;
  794.                 }
  795.                 // should be an img element
  796.                 var \$elem = \$(elem);
  797.                 // grab the src of the image
  798.                 var src = \$elem.attr('src');
  799.                 // set new html for loading purposes
  800.                 var \$parent = \$elem.parent();
  801.                 \$parent.html('<img alt=\"\" src=\"/bundles/cmscore/loading.gif\" />');
  802.                 // set a callback that runs in a few seconds to try and reload the image
  803.                 setTimeout((function(parent, src, count) {
  804.                     return function() {
  805.                         if (count > 12) {
  806.                             return;
  807.                         }
  808.                         count++;
  809.                         var \$parent = \$(parent);
  810.                         if (\$.contains(document.documentElement, \$parent[0])) {
  811.                             \$parent.html('<img alt=\"\" src=\"' + src + '\" onerror=\"(function(elem){jQuery(function() {window.csimgloader(elem, ' + count + ');});})(this);\" />');
  812.                         }
  813.                     };
  814.                 })(\$parent[0], src, count), 5000);
  815.             }
  816.         })(window, document, jQuery);
  817.     </script>
  818. {% endinline %}
  819. {% inline_script %}
  820.     <script>
  821.         CKEDITOR.dtd.\$removeEmpty['em'] = false;
  822.         CKEDITOR.on('dialogDefinition', function(e) {
  823.             var dialog = e.data;
  824.             var dialogName = dialog.name;
  825.             var dialogDefinition = dialog.definition;
  826.             if (dialogName === 'link') {
  827.                 var infoTab = dialogDefinition.getContents('info');
  828.                 var urlOptions = infoTab.get('urlOptions');
  829.                 urlOptions.children.push({
  830.                     type: 'button',
  831.                     id: 'browseSite',
  832.                     label: 'Browse Files',
  833.                     title: 'Browse Files',
  834.                     onClick: function() {
  835.                         var urlField = this.getDialog().getContentElement('info', 'url'),
  836.                             cs = window.top.CAMPUSSUITE;
  837.                         CampussuiteModals.open({
  838.                             url: '/_dashboard/files/modal',
  839.                             params: {
  840.                                 mode: (typeof CKEDITOR_MODAL_OVERRIDE !== 'undefined') ? CKEDITOR_MODAL_OVERRIDE : 'url',
  841.                                 container: cs.container,
  842.                                 value: urlField.getValue()
  843.                             },
  844.                             callback: function(selection) {
  845.                                 urlField.setValue(selection);
  846.                             },
  847.                             styles: 'modal-dialog--media'
  848.                         });
  849.                     }
  850.                 });
  851.                 urlOptions.children.push({
  852.                     type: 'button',
  853.                     id: 'browseContent',
  854.                     label: 'Browse Content',
  855.                     title: 'Browse Content',
  856.                     onClick: function() {
  857.                         var urlField = this.getDialog().getContentElement('info', 'url'),
  858.                             cs = window.top.CAMPUSSUITE;
  859.                         CampussuiteModals.open({
  860.                             url: '/_dashboard/modules/modal',
  861.                             params: {
  862.                                 containerId: cs.container
  863.                             },
  864.                             callback: function(selection) {
  865.                                 urlField.setValue(selection);
  866.                             },
  867.                             styles: 'modal-dialog--media'
  868.                         });
  869.                     }
  870.                 });
  871.             }
  872.             if (dialogName === 'image') {
  873.                 var tb = dialogDefinition.getContents('info');
  874.                 var thing = tb.elements[0].children[0];
  875.                 thing.children.push({
  876.                     type: 'button',
  877.                     id: 'browseSite',
  878.                     label: 'Browse Files',
  879.                     title: 'Browse Files',
  880.                     onClick: function() {
  881.                         var urlField = this.getDialog().getContentElement('info', 'txtUrl'),
  882.                             cs = window.top.CAMPUSSUITE;
  883.                         CampussuiteModals.open({
  884.                             url: '/_dashboard/files/modal',
  885.                             params: {
  886.                                 mode: (typeof CKEDITOR_MODAL_OVERRIDE !== 'undefined') ? CKEDITOR_MODAL_OVERRIDE : 'url',
  887.                                 container: cs.container,
  888.                                 value: urlField.getValue()
  889.                             },
  890.                             callback: function(selection) {
  891.                                 urlField.setValue(selection);
  892.                             },
  893.                             styles: 'modal-dialog--media'
  894.                         });
  895.                     }
  896.                 });
  897.             }
  898.         });
  899.     </script>
  900. {% endinline %}
  901. {{ embed_script('/bundles/cmscore/AjaxSelect.js', null, null, 'bottom') }}
  902. <script type=\"text/javascript\">
  903.     window.CAMPUSSUITE = {
  904.         environment: '{{ cms.environment }}',
  905.         tenant: {
  906.             id: {{ cms.tenant.id }},
  907.             uid: '{{ cms.tenant.uid.toString() }}',
  908.             slug: '{{ cms.tenant.slug }}'
  909.         },
  910.         container: {{ (cms.department is not empty) ? cms.department.id : 'null' }}
  911.     };
  912. </script>
  913. {% inline_script %}
  914.     <script>
  915.         // Break point entry
  916.         \$(function() {
  917.             var \$window = \$(window),
  918.                 \$console = \$('#cs-console');
  919.             \$window
  920.                 .bind('enterBreakpoint321', function () {
  921.                     if (\$console.hasClass('sb-disable-autoload')) {
  922.                         return;
  923.                     }
  924.                     \$console
  925.                         .removeClass('cs-console-md')
  926.                         .removeClass('cs-console-lg sb-expand')
  927.                         .addClass('cs-console-sm sb-collapse');
  928.                 })
  929.                 .bind('enterBreakpoint481', function () {
  930.                     if (\$console.hasClass('sb-disable-autoload')) {
  931.                         return;
  932.                     }
  933.                     \$console
  934.                         .removeClass('cs-console-md')
  935.                         .removeClass('cs-console-lg sb-expand')
  936.                         .addClass('cs-console-sm sb-collapse');
  937.                 })
  938.                 .bind('enterBreakpoint821', function () {
  939.                     if (\$console.hasClass('sb-disable-autoload')) {
  940.                         return;
  941.                     }
  942.                     \$console
  943.                         .removeClass('cs-console-sm')
  944.                         .removeClass('cs-console-lg sb-expand')
  945.                         .addClass('cs-console-md sb-collapse');
  946.                 })
  947.                 .bind('enterBreakpoint1065', function () {
  948.                     if (\$console.hasClass('sb-disable-autoload')) {
  949.                         return;
  950.                     }
  951.                     \$console
  952.                         .removeClass('cs-console-sm sb-collapse')
  953.                         .removeClass('cs-console-md sb-collapse')
  954.                         .addClass('cs-console-lg sb-expand');
  955.                 });
  956.             \$window.setBreakpoints({
  957.                 distinct: true,
  958.                 breakpoints: [
  959.                     // needing to set breakpoints at one pixel above where they should
  960.                     // this better matches current css media queries
  961.                     // these events need triggered once the viewport extends beyond the designated \"real\" sizes, hence the extra pixel
  962.                     321,// 320
  963.                     481,// 480
  964.                     821,// 820
  965.                     1065// 1064
  966.                 ]
  967.             });
  968.         });
  969.         // Console Sidebar Toggle
  970.         \$(function() {
  971.             var \$toggle = \$('.cs-console-sb-toggle'),
  972.                 \$console = \$('#cs-console');
  973.             \$toggle.click(function () {
  974.                 if (\$console.hasClass('sb-collapse')) {
  975.                     \$console
  976.                         .removeClass('sb-collapse')
  977.                         .addClass('sb-expand');
  978.                 } else {
  979.                     \$console
  980.                         .removeClass('sb-expand')
  981.                         .addClass('sb-collapse');
  982.                 }
  983.             });
  984.         });
  985.         // Console Sidebar Hover
  986.         \$(function() {
  987.             var \$sidebar = \$('#cs-console-sidebar'),
  988.                 \$console = \$('#cs-console');
  989.             \$sidebar.hover(
  990.                 function () {
  991.                     //if ( ! \$console.hasClass('cs-console-sm')) {
  992.                     if (\$console.hasClass('cs-console-md')) {
  993.                         \$console
  994.                             .addClass('sb-expand')
  995.                             .removeClass('sb-collapse');
  996.                     }
  997.                 },
  998.                 function () {
  999.                     if (\$console.hasClass('cs-console-md')) {
  1000.                         \$console
  1001.                             .addClass('sb-collapse')
  1002.                             .removeClass('sb-expand');
  1003.                     }
  1004.                 }
  1005.             );
  1006.         });
  1007.         // Console Sidebar Nav Toggle
  1008.         \$(function() {
  1009.             \$('ul.editor__side-nav').on('click', 'a', function(e) {
  1010.                 var \$link = \$(e.currentTarget),
  1011.                     \$topmenu = \$link.closest('ul'),
  1012.                     \$topitem = \$link.closest('li');
  1013.                 // remove the active state from all current items
  1014.                 // skip the currently selected item to prevent odd behavior
  1015.                 \$topmenu
  1016.                     .find('li')
  1017.                     .not(\$topitem)
  1018.                     .removeClass('active');
  1019.                 // activate the current items
  1020.                 \$topitem.addClass('active');
  1021.             });
  1022.             \$('ul.cs-console-sb-menu').on('click', 'a', function(e) {
  1023.                 var \$link = \$(e.currentTarget),
  1024.                     \$topmenu = \$link.closest('ul'),
  1025.                     \$submenu = null,
  1026.                     \$topitem = null,
  1027.                     \$subitem = null;
  1028.                 // fix the menus
  1029.                 if (\$topmenu.hasClass('cs-sub-menu')) {
  1030.                     \$submenu = \$topmenu;
  1031.                     \$topmenu = \$submenu.closest('ul');
  1032.                 }
  1033.                 // if there is a submenu above, then there are two items to consider
  1034.                 if (\$submenu !== null) {
  1035.                     \$subitem = \$link.closest('li');
  1036.                     \$topitem = \$subitem.closest('li');
  1037.                 } else {
  1038.                     \$topitem = \$link.closest('li');
  1039.                 }
  1040.                 // now, there might be a submenu related that we need to show
  1041.                 // if nothing returns, clear out the variable
  1042.                 \$submenu = \$topitem.children('ul.cs-sub-menu');
  1043.                 if (\$submenu.length === 0) {
  1044.                     \$submenu = null;
  1045.                 }
  1046.                 // remove the active state from all current items
  1047.                 // skip the currently selected item to prevent odd behavior
  1048.                 \$topmenu
  1049.                     .find('li')
  1050.                     .not(\$topitem)
  1051.                     .not(\$subitem)
  1052.                     .removeClass('active');
  1053.                 // slide up all open submenus
  1054.                 // skip the currently selected item to prevent odd behavior
  1055.                 \$topmenu
  1056.                     .find('ul.cs-sub-menu')
  1057.                     .not(\$submenu)
  1058.                     .slideUp(200);
  1059.                 // activate the current items
  1060.                 \$topitem.addClass('active');
  1061.                 if (\$subitem !== null) {
  1062.                     \$subitem.addClass('active');
  1063.                 }
  1064.                 // if we have a submenu, open it
  1065.                 // items with submenus should not have other actions, prevent default then
  1066.                 if (\$submenu !== null) {
  1067.                     \$submenu.slideDown(200);
  1068.                     e.preventDefault();
  1069.                 }
  1070.             });
  1071.         });
  1072.         // Console Sidebar Slimscroll
  1073.         \$(function() {
  1074.             var resizeListener;
  1075.             var pause = 500;
  1076.             \$('.sb-scroll').slimScroll({
  1077.                 height: 'auto',
  1078.                 size: '10px'
  1079.             });
  1080.             \$(window).resize(function(){
  1081.                 clearTimeout(resizeListener);
  1082.                 resizeListener = setTimeout(
  1083.                     function() {
  1084.                         \$('.sb-scroll').slimScroll({
  1085.                             height: 'auto'
  1086.                         });
  1087.                     },
  1088.                     pause
  1089.                 );
  1090.             });
  1091.         });
  1092.     </script>
  1093. {% endinline %}
  1094. {% inline_script %}
  1095.     <script>
  1096.         \$('[data-topbar=\"popover-bottom\"]').popover({
  1097.             html: true,
  1098.             placement: 'bottom',
  1099.             sanitize: false,
  1100.             content: function () {
  1101.                 return \$(this).siblings('.dropdown-content').html();
  1102.             }
  1103.         });
  1104.         // Close popovers
  1105.         \$('body').on('click', function (e) {
  1106.             \$('[data-topbar=\"popover-bottom\"]').each(function () {
  1107.                 if (!\$(this).is(e.target) && \$(this).has(e.target).length === 0 && \$('.popover').has(e.target).length === 0) {
  1108.                     \$(this).popover('hide');
  1109.                 }
  1110.             });
  1111.         });
  1112.         // tooltips: https://getbootstrap.com/docs/3.3/javascript/#tooltips-examples
  1113.         \$(function () {
  1114.             const elements = \$('[data-toggle=\"tooltip\"]');
  1115.             for (let i=0; i < elements.length; i++) {
  1116.                 const element = \$(elements[i]);
  1117.                 const isTriggeredByClick = ('click' === element.data('trigger'));
  1118.                 element.tooltip({
  1119.                     container: 'body',
  1120.                     placement: element.data('placement') ?? 'right',
  1121.                     trigger: isTriggeredByClick ? 'manual' : 'hover',
  1122.                     html: true,
  1123.                     template: '<div class=\"tooltip tooltip-custom\" role=\"tooltip\"><div class=\"tooltip-arrow tooltip-arrow-custom\"></div><div class=\"tooltip-inner tooltip-inner-custom\"></div></div>',
  1124.                 });
  1125.                 if (isTriggeredByClick) {
  1126.                     element.on('click', function (event) {
  1127.                         event.preventDefault();
  1128.                         event.stopPropagation();
  1129.                         \$(this).tooltip('show');
  1130.                     });
  1131.                 }
  1132.                 element.on('show.bs.tooltip', function () {
  1133.                     const displayedTitle = \$(this).data('originalTitle');
  1134.                     const tooltipElements = \$('[data-toggle=\"tooltip\"]');
  1135.                     for (let i=0; i < tooltipElements.length; i++) {
  1136.                         if (displayedTitle !== \$(tooltipElements[i]).data('originalTitle')) {
  1137.                             \$(tooltipElements[i]).tooltip('hide');
  1138.                         }
  1139.                     }
  1140.                 });
  1141.             }
  1142.             \$('body').on('click', function () {
  1143.                 \$('[data-toggle=\"tooltip\"]').tooltip('hide');
  1144.             });
  1145.         });
  1146.     </script>
  1147. {% endinline %}
  1148. {% include '@ui/dashboards/default/scripts/google-analytics.html.twig' %}
  1149. {% include '@ui/dashboards/default/scripts/zendesk.html.twig' %}
  1150. {% include '@ui/dashboards/default/scripts/churnzero.html.twig' %}
  1151. ""@ui/dashboards/default/scripts.html.twig""/var/www/campussuite/ui/twig/dashboards/default/scripts.html.twig");
  1152.     }
  1153. }