editor.blade.php 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <div class="{{$viewClass['form-group']}}">
  2. <label class="{{$viewClass['label']}} control-label">{!! $label !!}</label>
  3. <div class="{{$viewClass['field']}}">
  4. @include('admin::form.error')
  5. <textarea class="form-control {{$class}}" name="{{$name}}" placeholder="{{ $placeholder }}" {!! $attributes !!} >{{ $value }}</textarea>
  6. @include('admin::form.help-block')
  7. </div>
  8. </div>
  9. <script require="@tinymce" init="{!! $selector !!}">
  10. var opts = {!! admin_javascript_json($options) !!};
  11. opts.selector = '#'+id;
  12. if (! opts.init_instance_callback) {
  13. opts.init_instance_callback = function (editor) {
  14. editor.on('Change', function(e) {
  15. $this.val(String(e.target.getContent()).replace('<p><br data-mce-bogus="1"></p>', '').replace('<p><br></p>', ''));
  16. });
  17. }
  18. }
  19. opts.setup = function (editor) {
  20. editor.ui.registry.addIcon('myCustomIcon1', '<svg t="1748573632733" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="29351" width="24" height="24"><path d="M893.09536344 340.61983656V178.25968172c0-25.93252473-20.85876989-47.35504516-47.35504516-47.35504516H178.25968172c-25.93252473 0-47.35504516 20.85876989-47.35504516 47.35504516v162.36015484h762.19072688zM381.20987527 393.6123871H131.4683871v452.12793118c0 25.93252473 20.85876989 47.35504516 47.35504516 47.35504516h202.38644301V393.6123871z m52.4288 0V892.5316129h412.66539355c33.26128172 0 46.22754408-18.04001721 46.22754408-46.22754408V393.6123871H433.63867527z" fill="#2C2C2C" p-id="29352"></path></svg>');
  21. editor.ui.registry.addIcon('myCustomIconLeft', '<svg t="1748572285440" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="25026" width="24" height="24"><path d="M853.333333 128H170.666667c-25.6 0-42.666667 17.066667-42.666667 42.666667v682.666666c0 25.6 17.066667 42.666667 42.666667 42.666667h682.666666c25.6 0 42.666667-17.066667 42.666667-42.666667V170.666667c0-25.6-17.066667-42.666667-42.666667-42.666667zM213.333333 213.333333h256v256H213.333333V213.333333z m0 597.333334v-256h256v256H213.333333z m597.333334 0h-256V213.333333h256v597.333334z" fill="#09121F" p-id="25027"></path></svg>');
  22. editor.ui.registry.addIcon('myCustomIconRight', '<svg t="1748572229839" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="24877" width="24" height="24"><path d="M853.333333 128H170.666667c-25.6 0-42.666667 17.066667-42.666667 42.666667v682.666666c0 25.6 17.066667 42.666667 42.666667 42.666667h682.666666c25.6 0 42.666667-17.066667 42.666667-42.666667V170.666667c0-25.6-17.066667-42.666667-42.666667-42.666667zM213.333333 810.666667V213.333333h256v597.333334H213.333333z m597.333334 0h-256v-256h256v256z m0-341.333334h-256V213.333333h256v256z" fill="#09121F" p-id="24878"></path></svg>');
  23. editor.ui.registry.addButton('myLayoutLeft', {
  24. text: '',
  25. icon: 'myCustomIconLeft',
  26. tooltip: 'Insert Left Layout',
  27. onAction: function () {
  28. const html = tinymce.get(editor.id).getContent();
  29. const insterEle = '<div style="padding: 0px 20px 0px 20px;display: block;color: #666;font-size: 16px;line-height: 1.75;-webkit-box-sizing: border-box;font-family: \'Poppins\', \'sans-serif\', \'Arial\';-webkit-font-smoothing: antialiased;unicode-bidi: isolate;"><div style="display: flex;"><div style="width: 65%;padding: 40px 60px;margin: 0;webkit-box-sizing: border-box;font-family: \'Poppins\', \'sans-serif\', \'Arial\';-webkit-font-smoothing: antialiased;display: block;unicode-bidi: isolate;color: #666;font-size: 16px;line-height: 1.75;"><h3 style="font-size: 36px;font-weight: bold;color: #333;margin-bottom: 36px;line-height: 1.75;margin-top: 1em;-webkit-box-sizing: border-box;-moz-box-sizing: border-box;font-family: \'Poppins\', \'sans-serif\', \'Arial\';-webkit-font-smoothing: antialiased;">Intelligent cutting and pasting all-in-one machine </h3><p style="padding: 0;margin: 0;-webkit-box-sizing: border-box;-moz-box-sizing: border-box;font-family: \'Poppins\', \'sans-serif\', \'Arial\';-webkit-font-smoothing: antialiased;color: #666;font-size: 16px;">Intelligent cutting and pasting all-in-one machineFull process automation: integrated cloud database to retrieve model data, laser cutting, vacuum adsorption film, UV curing and other links, eliminating the cumbersome operation of multi-equipment switching, to achieve “one-click” service.</p><\/div><div style="line-height: 1.75;margin-bottom: 1.5em;"><img src="https://mietubl-website.oss-cn-hongkong.aliyuncs.com/static/common/images/500px.png" style="max-width: 100%;border: 0;overflow-clip-margin: content-box;overflow: clip;"><\/div><\/div><\/div><br \/>';
  30. tinymce.activeEditor.setContent(html+insterEle);
  31. }
  32. });
  33. editor.ui.registry.addButton('myLayoutRight', {
  34. text: '',
  35. icon: 'myCustomIconRight',
  36. tooltip: 'Insert Right Layout',
  37. onAction: function () {
  38. const html = tinymce.get(editor.id).getContent();
  39. const insterEle = '<div style="padding: 0px 20px 0px 20px;display: block;color: #666;font-size: 16px;line-height: 1.75;-webkit-box-sizing: border-box;font-family: \'Poppins\', \'sans-serif\', \'Arial\';-webkit-font-smoothing: antialiased;unicode-bidi: isolate;"><div style="display: flex;"><div style="width: 65%;padding: 40px 60px;margin: 0;webkit-box-sizing: border-box;font-family: \'Poppins\', \'sans-serif\', \'Arial\';-webkit-font-smoothing: antialiased;display: block;unicode-bidi: isolate;color: #666;font-size: 16px;line-height: 1.75;"><h3 style="font-size: 36px;font-weight: bold;color: #333;margin-bottom: 36px;line-height: 1.75;margin-top: 1em;-webkit-box-sizing: border-box;-moz-box-sizing: border-box;font-family: \'Poppins\', \'sans-serif\', \'Arial\';-webkit-font-smoothing: antialiased;">European Union certified intelligent film cutting machine</h3><p style="padding: 0;margin: 0;-webkit-box-sizing: border-box;-moz-box-sizing: border-box;font-family: \'Poppins\', \'sans-serif\', \'Arial\';-webkit-font-smoothing: antialiased;color: #666;font-size: 16px;">24000+ models updated in the cloud, on-demand cut phone/tablet/watch film, open consumables, personalized back film customization, one machine to solve the inventory problem.</p><\/div><div style="order: -1;line-height: 1.75;margin-bottom: 1.5em;"><img src="https://mietubl-website.oss-cn-hongkong.aliyuncs.com/static/common/images/500px.png" style="max-width: 100%;border: 0;overflow-clip-margin: content-box;overflow: clip;"><\/div><\/div><\/div><br \/>';
  40. tinymce.activeEditor.setContent(html+insterEle);
  41. }
  42. });
  43. }
  44. opts.max_height = 730;
  45. tinymce.init(opts)
  46. </script>