templates/theme_learts/editproduct.html.twig line 1

Open in your IDE?
  1. {% extends 'theme_' ~ constant('config_theme') ~ '/base.html.twig' %}
  2. {% block maincontent %}
  3.     <div class="container">
  4.         <iframe class="w-100" id="chili-iframe" onload="iFrameLoaded()" src="{{ url }}"></iframe>
  5.         <input type="hidden" id="chilidocument_id" value="{{ docid }}">
  6.         <button id="saveeditordocumentbutton" disabled="disabled" type="button" class="btn btn-success btn-fill" style="display:none;" onclick="saveEditorDocument()">Lagre</button>
  7.     </div>
  8. {% endblock %}
  9. {% block footer %}
  10. {% endblock %}
  11. {% block bodyjavascript %}
  12.     <script>
  13.         $.LoadingOverlay('show');
  14.         function saveEditorDocument() {
  15.             toggleFullOverlayTo('show');
  16.             var chilidocument_id = $('#chilidocument_id').val();
  17.             var chili_xml = editor.ExecuteFunction('document','GetTempXML');
  18.             var postdata = 'chilidocument_id=' + chilidocument_id + '&chili_xml=' + encodeURIComponent(chili_xml);
  19.             $.post('/saveChilidocumentToBasket', postdata, function(json) {
  20.                 try {
  21.                     logg(json);
  22.                     updateNumInBasket();
  23.                     toggleFullOverlayTo('hide');
  24.                 } catch(e) {
  25.                     console.log(e);
  26.                 }
  27.             });
  28.         }
  29.         function loaddocument() {
  30.             editor.ExecuteFunction('document','OpenDocumentFromXml','{{ docxml | raw }}','','','');
  31.         }
  32.         theInterval = setInterval(function() {
  33.             if (typeof editor !== 'undefined') {
  34.                 clearInterval(theInterval);
  35.                 loaddocument();
  36.                 toggleFullOverlayTo('hide');
  37.             } else {
  38.                 // Wait 1 sec...
  39.                 logg('Waiting for editor');
  40.             }
  41.         }, 1000);
  42.     </script>
  43. {% endblock %}