Showing
7 changed files
with
56 additions
and
11 deletions
| ... | ... | @@ -1357,7 +1357,10 @@ $('body').on('click', '.copy-to-memory', function(){ |
| 1357 | 1357 | document.execCommand('copy'); |
| 1358 | 1358 | document.body.removeChild(el); |
| 1359 | 1359 | |
| 1360 | - bootbox.alert('URL copied to memory'); | |
| 1360 | + $.notify('URL is saved in the clipboard', { | |
| 1361 | + status: 'info', | |
| 1362 | + pos:"top-right" | |
| 1363 | + }); | |
| 1361 | 1364 | |
| 1362 | 1365 | return false; |
| 1363 | 1366 | }); |
| ... | ... | @@ -1550,9 +1553,15 @@ var initAjaxFileUpload = function(selector){ |
| 1550 | 1553 | var key = $(data.jqXHR.responseXML).find("Key").text(); |
| 1551 | 1554 | var url = 'https://' + fileInputElem.data('host') + '/' + key; |
| 1552 | 1555 | |
| 1556 | + | |
| 1557 | + | |
| 1553 | 1558 | // create hidden field |
| 1554 | - var input = $("<input />", {type: 'hidden', class: 'hidden-file-link', name: fileInputElem.attr('name'), value: url}) | |
| 1559 | + var input = $("<input />", {type: 'hidden', class: 'hidden-file-link', name: fileInputElem.attr('name'), value: url}); | |
| 1560 | + var inputFileType = $("<input />", {type: 'hidden', class: 'hidden-file-link', name: fileInputElem.attr('name').replace('image_link', 'file_type'), value: fileInputElem.data('files')[0].file.type}) | |
| 1561 | + | |
| 1555 | 1562 | form.append(input); |
| 1563 | + form.append(inputFileType); | |
| 1564 | + | |
| 1556 | 1565 | fileInputElem.val(''); |
| 1557 | 1566 | }, |
| 1558 | 1567 | fail: function (e, data) { |
| ... | ... | @@ -1732,7 +1741,11 @@ jQuery(document).ready(function(){ |
| 1732 | 1741 | //fontFamily: fonts, |
| 1733 | 1742 | //fontSize: fontSizes, |
| 1734 | 1743 | height:400, |
| 1735 | - toolbarButtons: ['underline', 'fontFamily', 'fontSize', 'color', 'paragraphStyle', 'paragraphFormat', 'align', 'formatOL', 'formatUL', 'outdent', 'indent', 'quote', 'insertHR', 'insertLink', 'cms-image', 'insertTable', 'undo', 'redo', 'clearFormatting', 'html', 'fullscreen'] | |
| 1744 | + toolbarButtons: ['fontFamily', 'fontSize', '|', 'bold', 'italic', 'underline', 'strikeThrough', '|', 'subscript', 'superscript', '|' ,'color', 'paragraphStyle', 'paragraphFormat', 'align', '|', 'formatOL', 'formatUL', 'outdent', 'indent', '|', 'quote', 'insertHR', '|', 'cms-image', '|', 'insertTable', '-', 'undo', 'redo', 'clearFormatting', '|', 'html', 'fullscreen'], | |
| 1745 | + toolbarButtonsMD: ['fontFamily', 'fontSize', '|', 'bold', 'italic', 'underline', 'strikeThrough', '|', 'subscript', 'superscript', '|' ,'color', 'paragraphStyle', 'paragraphFormat', 'align', '|', 'formatOL', 'formatUL', 'outdent', 'indent', '|', 'quote', 'insertHR', '|', 'cms-image', '|', 'insertTable', '-', 'undo', 'redo', 'clearFormatting', '|', 'html', 'fullscreen'], | |
| 1746 | + toolbarButtonsSM: ['fontFamily', 'fontSize', '|', 'bold', 'italic', 'underline', 'strikeThrough', '|', 'subscript', 'superscript', '|' ,'color', 'paragraphStyle', 'paragraphFormat', 'align', '|', 'formatOL', 'formatUL', 'outdent', 'indent', '|', 'quote', 'insertHR', '|', 'cms-image', '|', 'insertTable', '-', 'undo', 'redo', 'clearFormatting', '|', 'html', 'fullscreen'], | |
| 1747 | + toolbarButtonsXS: ['fontFamily', 'fontSize', '|', 'bold', 'italic', 'underline', 'strikeThrough', '|', 'subscript', 'superscript', '|' ,'color', 'paragraphStyle', 'paragraphFormat', 'align', '|', 'formatOL', 'formatUL', 'outdent', 'indent', '|', 'quote', 'insertHR', '|', 'cms-image', '|', 'insertTable', '-', 'undo', 'redo', 'clearFormatting', '|', 'html', 'fullscreen'], | |
| 1748 | + imageEditButtons: ['imageAlign', 'imageCaption', 'imageRemove', '|', 'linkOpen', 'linkEdit', 'linkRemove', '-', 'imageDisplay', 'imageStyle', 'imageSize'], | |
| 1736 | 1749 | }); |
| 1737 | 1750 | |
| 1738 | 1751 | } |
| ... | ... | @@ -1801,6 +1814,9 @@ jQuery(document).ready(function(){ |
| 1801 | 1814 | |
| 1802 | 1815 | $template.find('.remove').click(function(){ |
| 1803 | 1816 | $(this).closest('.new-image-wrapper').find('.fileinput-remove').trigger('click'); |
| 1817 | + if($('#new_images .card').length == 0){ | |
| 1818 | + $('#gallery_form form input:submit').addClass('not-visible'); | |
| 1819 | + } | |
| 1804 | 1820 | return false; |
| 1805 | 1821 | }); |
| 1806 | 1822 | $('#gallery_form form #new_images').append($template); |
| ... | ... | @@ -1915,6 +1931,23 @@ jQuery(document).ready(function(){ |
| 1915 | 1931 | source: tagnames.ttAdapter() |
| 1916 | 1932 | } |
| 1917 | 1933 | }); |
| 1934 | + $this.find('.filestyle').each(function() { | |
| 1935 | + var $this = $(this), options = { | |
| 1936 | + 'input' : $this.attr('data-input') !== 'false', | |
| 1937 | + 'htmlIcon' : $this.attr('data-icon'), | |
| 1938 | + 'buttonBefore' : $this.attr('data-buttonBefore') === 'true', | |
| 1939 | + 'disabled' : $this.attr('data-disabled') === 'true', | |
| 1940 | + 'size' : $this.attr('data-size'), | |
| 1941 | + 'text' : $this.attr('data-text'), | |
| 1942 | + 'btnClass' : $this.attr('data-btnClass'), | |
| 1943 | + 'badge' : $this.attr('data-badge') === 'true', | |
| 1944 | + 'dragdrop' : $this.attr('data-dragdrop') !== 'false', | |
| 1945 | + 'badgeName' : $this.attr('data-badgeName'), | |
| 1946 | + 'placeholder': $this.attr('data-placeholder') | |
| 1947 | + }; | |
| 1948 | + | |
| 1949 | + $this.filestyle(options); | |
| 1950 | + }); | |
| 1918 | 1951 | initAjaxFileUpload($this); |
| 1919 | 1952 | |
| 1920 | 1953 | }).on('hidden.bs.modal', function (e) { | ... | ... |
| ... | ... | @@ -135,7 +135,11 @@ jQuery(document).ready(function(){ |
| 135 | 135 | $selector.find('.page_html_content').froalaEditor({ |
| 136 | 136 | theme: 'gray', |
| 137 | 137 | height: 400, |
| 138 | - toolbarButtons: ['underline', 'fontFamily', 'fontSize', 'color', 'paragraphStyle', 'paragraphFormat', 'align', 'formatOL', 'formatUL', 'outdent', 'indent', 'quote', 'insertHR', 'insertLink', 'cms-image', 'insertTable', 'undo', 'redo', 'clearFormatting', 'html', 'fullscreen'] | |
| 138 | + toolbarButtons: ['fontFamily', 'fontSize', '|', 'bold', 'italic', 'underline', 'strikeThrough', '|', 'subscript', 'superscript', '|' ,'color', 'paragraphStyle', 'paragraphFormat', 'align', '|', 'formatOL', 'formatUL', 'outdent', 'indent', '|', 'quote', 'insertHR', '|', 'cms-image', '|', 'insertTable', '-', 'undo', 'redo', 'clearFormatting', '|', 'html', 'fullscreen'], | |
| 139 | + toolbarButtonsMD: ['fontFamily', 'fontSize', '|', 'bold', 'italic', 'underline', 'strikeThrough', '|', 'subscript', 'superscript', '|' ,'color', 'paragraphStyle', 'paragraphFormat', 'align', '|', 'formatOL', 'formatUL', 'outdent', 'indent', '|', 'quote', 'insertHR', '|', 'cms-image', '|', 'insertTable', '-', 'undo', 'redo', 'clearFormatting', '|', 'html', 'fullscreen'], | |
| 140 | + toolbarButtonsSM: ['fontFamily', 'fontSize', '|', 'bold', 'italic', 'underline', 'strikeThrough', '|', 'subscript', 'superscript', '|' ,'color', 'paragraphStyle', 'paragraphFormat', 'align', '|', 'formatOL', 'formatUL', 'outdent', 'indent', '|', 'quote', 'insertHR', '|', 'cms-image', '|', 'insertTable', '-', 'undo', 'redo', 'clearFormatting', '|', 'html', 'fullscreen'], | |
| 141 | + toolbarButtonsXS: ['fontFamily', 'fontSize', '|', 'bold', 'italic', 'underline', 'strikeThrough', '|', 'subscript', 'superscript', '|' ,'color', 'paragraphStyle', 'paragraphFormat', 'align', '|', 'formatOL', 'formatUL', 'outdent', 'indent', '|', 'quote', 'insertHR', '|', 'cms-image', '|', 'insertTable', '-', 'undo', 'redo', 'clearFormatting', '|', 'html', 'fullscreen'], | |
| 142 | + imageEditButtons: ['imageAlign', 'imageCaption', 'imageRemove', '|', 'linkOpen', 'linkEdit', 'linkRemove', '-', 'imageDisplay', 'imageStyle', 'imageSize'], | |
| 139 | 143 | }); |
| 140 | 144 | } |
| 141 | 145 | ... | ... |
| ... | ... | @@ -293,7 +293,11 @@ var csrf_token = $('meta[name=csrf-token]').attr('content'), |
| 293 | 293 | $('.page_html_content').froalaEditor({ |
| 294 | 294 | theme: 'gray', |
| 295 | 295 | height: 400, |
| 296 | - toolbarButtons: ['underline', 'fontFamily', 'fontSize', 'color', 'paragraphStyle', 'paragraphFormat', 'align', 'formatOL', 'formatUL', 'outdent', 'indent', 'quote', 'insertHR', 'insertLink', 'cms-image', 'insertTable', 'undo', 'redo', 'clearFormatting', 'html', 'fullscreen'] | |
| 296 | + toolbarButtons: ['fontFamily', 'fontSize', '|', 'bold', 'italic', 'underline', 'strikeThrough', '|', 'subscript', 'superscript', '|' ,'color', 'paragraphStyle', 'paragraphFormat', 'align', '|', 'formatOL', 'formatUL', 'outdent', 'indent', '|', 'quote', 'insertHR', '|', 'cms-image', '|', 'insertTable', '-', 'undo', 'redo', 'clearFormatting', '|', 'html', 'fullscreen'], | |
| 297 | + toolbarButtonsMD: ['fontFamily', 'fontSize', '|', 'bold', 'italic', 'underline', 'strikeThrough', '|', 'subscript', 'superscript', '|' ,'color', 'paragraphStyle', 'paragraphFormat', 'align', '|', 'formatOL', 'formatUL', 'outdent', 'indent', '|', 'quote', 'insertHR', '|', 'cms-image', '|', 'insertTable', '-', 'undo', 'redo', 'clearFormatting', '|', 'html', 'fullscreen'], | |
| 298 | + toolbarButtonsSM: ['fontFamily', 'fontSize', '|', 'bold', 'italic', 'underline', 'strikeThrough', '|', 'subscript', 'superscript', '|' ,'color', 'paragraphStyle', 'paragraphFormat', 'align', '|', 'formatOL', 'formatUL', 'outdent', 'indent', '|', 'quote', 'insertHR', '|', 'cms-image', '|', 'insertTable', '-', 'undo', 'redo', 'clearFormatting', '|', 'html', 'fullscreen'], | |
| 299 | + toolbarButtonsXS: ['fontFamily', 'fontSize', '|', 'bold', 'italic', 'underline', 'strikeThrough', '|', 'subscript', 'superscript', '|' ,'color', 'paragraphStyle', 'paragraphFormat', 'align', '|', 'formatOL', 'formatUL', 'outdent', 'indent', '|', 'quote', 'insertHR', '|', 'cms-image', '|', 'insertTable', '-', 'undo', 'redo', 'clearFormatting', '|', 'html', 'fullscreen'], | |
| 300 | + imageEditButtons: ['imageAlign', 'imageCaption', 'imageRemove', '|', 'linkOpen', 'linkEdit', 'linkRemove', '-', 'imageDisplay', 'imageStyle', 'imageSize'], | |
| 297 | 301 | }); |
| 298 | 302 | |
| 299 | 303 | ajaxFileUpload = initAjaxFileUpload($data); |
| ... | ... | @@ -341,7 +345,11 @@ var csrf_token = $('meta[name=csrf-token]').attr('content'), |
| 341 | 345 | $data.find('.page_html_content').froalaEditor({ |
| 342 | 346 | theme: 'gray', |
| 343 | 347 | height: 400, |
| 344 | - toolbarButtons: ['underline', 'fontFamily', 'fontSize', 'color', 'paragraphStyle', 'paragraphFormat', 'align', 'formatOL', 'formatUL', 'outdent', 'indent', 'quote', 'insertHR', 'insertLink', 'cms-image', 'insertTable', 'undo', 'redo', 'clearFormatting', 'html', 'fullscreen'] | |
| 348 | + toolbarButtons: ['fontFamily', 'fontSize', '|', 'bold', 'italic', 'underline', 'strikeThrough', '|', 'subscript', 'superscript', '|' ,'color', 'paragraphStyle', 'paragraphFormat', 'align', '|', 'formatOL', 'formatUL', 'outdent', 'indent', '|', 'quote', 'insertHR', '|', 'cms-image', '|', 'insertTable', '-', 'undo', 'redo', 'clearFormatting', '|', 'html', 'fullscreen'], | |
| 349 | + toolbarButtonsMD: ['fontFamily', 'fontSize', '|', 'bold', 'italic', 'underline', 'strikeThrough', '|', 'subscript', 'superscript', '|' ,'color', 'paragraphStyle', 'paragraphFormat', 'align', '|', 'formatOL', 'formatUL', 'outdent', 'indent', '|', 'quote', 'insertHR', '|', 'cms-image', '|', 'insertTable', '-', 'undo', 'redo', 'clearFormatting', '|', 'html', 'fullscreen'], | |
| 350 | + toolbarButtonsSM: ['fontFamily', 'fontSize', '|', 'bold', 'italic', 'underline', 'strikeThrough', '|', 'subscript', 'superscript', '|' ,'color', 'paragraphStyle', 'paragraphFormat', 'align', '|', 'formatOL', 'formatUL', 'outdent', 'indent', '|', 'quote', 'insertHR', '|', 'cms-image', '|', 'insertTable', '-', 'undo', 'redo', 'clearFormatting', '|', 'html', 'fullscreen'], | |
| 351 | + toolbarButtonsXS: ['fontFamily', 'fontSize', '|', 'bold', 'italic', 'underline', 'strikeThrough', '|', 'subscript', 'superscript', '|' ,'color', 'paragraphStyle', 'paragraphFormat', 'align', '|', 'formatOL', 'formatUL', 'outdent', 'indent', '|', 'quote', 'insertHR', '|', 'cms-image', '|', 'insertTable', '-', 'undo', 'redo', 'clearFormatting', '|', 'html', 'fullscreen'], | |
| 352 | + imageEditButtons: ['imageAlign', 'imageCaption', 'imageRemove', '|', 'linkOpen', 'linkEdit', 'linkRemove', '-', 'imageDisplay', 'imageStyle', 'imageSize'], | |
| 345 | 353 | }); |
| 346 | 354 | |
| 347 | 355 | $('#accordion').append($data); | ... | ... |
| ... | ... | @@ -43,7 +43,8 @@ |
| 43 | 43 | <%= f.file_field :image_link, :class => "form-control filestyle", 'data-url' => @s3_direct_post.url, 'data-form-data' => @s3_direct_post.fields.to_json, 'data-host' => URI.parse(@s3_direct_post.url).host , 'data-type' => 'zip', 'data-classbutton' => 'btn btn-secondary', 'data-classinput' => "form-control inline", 'data-icon' => "<span class='fa fa-upload mr-2'></span>" %> |
| 44 | 44 | </div> |
| 45 | 45 | </div> |
| 46 | - </fieldset> | |
| 46 | + </fieldset> | |
| 47 | + | |
| 47 | 48 | |
| 48 | 49 | <div class="card-footer mt-20"> |
| 49 | 50 | <div class="clearfix"> | ... | ... |
| ... | ... | @@ -83,11 +83,10 @@ en: |
| 83 | 83 | default_use: "Use Default" |
| 84 | 84 | kanjai/page_template: |
| 85 | 85 | title: "Title" |
| 86 | - attachment: "Template file" | |
| 87 | 86 | updated_at: "Updated at" |
| 88 | 87 | unzip: "Status" |
| 89 | 88 | notice: "Notice" |
| 90 | - attachment: "Template" | |
| 89 | + attachment: "Template (as ZIP file)" | |
| 91 | 90 | kanjai/image: |
| 92 | 91 | name: "Name" |
| 93 | 92 | tags: "Tags" | ... | ... |