JAVASCRIPT   111

style-editor.js

Guest on 19th July 2021 07:03:15 PM

  1. function RedNaoStyleEditor()
  2. {
  3.     var self=this;
  4.     this.PreviewScreen=rnJQuery('#smartFormStyleEditorContainer');
  5.     this.AttributesCointainer=rnJQuery('#styleEditorAttributes');
  6.     this.Dialog=rnJQuery("#redNaoStyleEditor").dialog(
  7.         {   width:"1200",
  8.             height:"715",
  9.             modal:true,
  10.             autoOpen:false,
  11.             create: function(event, ui){
  12.                 rnJQuery('.ui-dialog').wrap('<div class="smartFormsSlider" />');
  13.             },
  14.             open: function(event, ui){
  15.                 rnJQuery('.ui-widget-overlay').wrap('<div class="smartFormsSlider" />');
  16.  
  17.             },
  18.             beforeClose:function(event,ui)
  19.             {
  20.  
  21.             }
  22.  
  23.  
  24.         });
  25. }
  26.  
  27. RedNaoStyleEditor.prototype.OpenStyleEditor=function(formElement,formElementJQuery)
  28. {
  29.     rnJQuery('#rnStyleEditorAttribute').click();
  30.     this.Dialog.dialog('open');
  31.     this.PreviewScreen.empty();
  32.     var div=rnJQuery("<div></div>");
  33.     this.PreviewScreen.append(div);
  34.     var elementToStyle=formElement.GenerateHtml(div);
  35.     rnJQuery('#allOfTypeOption').text('Every '+formElement.Title +' field');
  36.  
  37.     RedNaoDragManager.prototype.MakeItemDraggable(formElementJQuery);
  38.     RedNaoDragManager.prototype.MakeItemDraggable(elementToStyle);
  39.  
  40.  
  41.     this.AttributesCointainer.empty();
  42.     rnJQuery('.rnEditorContainer').hide();
  43.     this.AttributesCointainer.append("<table style='width: 100%;height: 100%;'><tr><td style='vertical-align:middle'><h1 style='width: 100%;text-align: center;'>"+smartFormsTranslation.ClickInAnElementToEditIt+"</h1></td></tr></table>");
  44.     this.Styler=GetElementStyler(formElement,elementToStyle,this.AttributesCointainer);
  45.  
  46. };
  47.  
  48.  
  49. var RedNaoStyleEditorVar=null;
  50. rnJQuery(function(){
  51.     RedNaoStyleEditorVar=new RedNaoStyleEditor();
  52. });

Raw Paste


Login or Register to edit or fork this paste. It's free.