Skip to content

Commit

Permalink
Merge pull request #26 from bolt/update-to-233
Browse files Browse the repository at this point in the history
Update to 233
  • Loading branch information
I-Valchev authored Mar 10, 2021
2 parents ec917ee + ab2cfdd commit ff5b6d0
Show file tree
Hide file tree
Showing 18 changed files with 975 additions and 8 deletions.
2 changes: 1 addition & 1 deletion assets/article/article-editor.min.js

Large diffs are not rendered by default.

7 changes: 3 additions & 4 deletions assets/article/license.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ Permitted Use

Article Editor License Tiers:

Pro License: Holder of the Pro License may use the current version of the Software for a sole purpose of integration it within an unlimited number of applications of an unlimited number of website, located on an unlimited number of domains with unlimited subdomains (*.domain.com) engaging in commercial, for-profit, or non-commercial, non-for-profit activities, including "Software as a Service" products (SaaS). The Pro License does not allow integration of the Software with Open Source products, or downloadable extensions, plugins or applications. Technical support to the Pro license holders is provided in form of Documentation on Imperavi.com website only; Pro License holders also allowed to submit bugs and request features via customer’s account page.
Pro License: Holder of the Pro License may use the current version of the Software for a sole purpose of integration it within an unlimited number of applications of an unlimited number of website, located on an unlimited number of domains with unlimited subdomains (*.domain.com) engaging in commercial, for-profit, or non-commercial, non-for-profit activities, including "Software as a Service" products (SaaS). The Pro License does not allow integration of the Software with open source products, or downloadable extensions, plugins or applications. Technical support to the Pro license holders is provided in form of Documentation on Imperavi.com website only; Pro License holders also allowed to submit bugs and request features via customer’s account page.

OEM License: Holder of the OEM License may use the current version of the Software for a sole purpose of integration it within an unlimited number of applications of an unlimited number of website, located on an unlimited number of domains with unlimited subdomains (*.domain.com) engaging in commercial, for-profit, or non-commercial, non-for-profit activities. The OEM License allows integration of “Software as a Service” products (SaaS), downloadable extensions, plugins and applications. The OEM License does not allow integration of the Software with Open Source products. Technical support to the OEM license holders is provided in a form of Documentation on Imperavi.com website only; OEM License holders also allowed to submit bugs and request features via customer’s account page.
OEM License: Holder of the OEM License may use the current version of the Software for a sole purpose of integration it within an unlimited number of applications of an unlimited number of website, located on an unlimited number of domains with unlimited subdomains (*.domain.com) engaging in commercial, for-profit, or non-commercial, non-for-profit activities. The OEM License allows integration of the Software with open source products, “Software as a Service” products (SaaS), downloadable extensions, plugins and applications. Technical support to the OEM license holders is provided in a form of Documentation on Imperavi.com website only; OEM License holders also allowed to submit bugs and request features via customer’s account page.

Upgrades, Updates, New Versions

Expand All @@ -24,7 +24,6 @@ Restrictions

Unless you have been granted prior, written explicit consent from Imperavi LLC, you may not:

— Use the Software in Open Source projects.
- Reproduce, distribute, or transfer the Software as a sole product, or portions thereof, to any third party.
- Sell, rent, lease, assign, or sublet the Software as a sole product or portions thereof.
- Grant rights to any other person.</li>
Expand All @@ -44,7 +43,7 @@ You may alter, modify, or extend the Software for use as an integral part of you

Technical Support

Technical support is provided in a form of Documentation on imperavi.com website only; License holders also allowed to submit bugs and suggest features via their customer account page. For the Bug Reports and Feature Suggestions we reserve the right to solely determine best course of action: we can accept, decline or postpone any work in regards of received Bug Reports or Feature Suggestion. We give no guarantee whatsoever that we will fix any particular malfunction, and we reserve the right to determine whether Reported Bug is a malfunction or not. We don’t give any guarantee whatsoever that we will implement any of Suggested Features.
Technical support is provided in a form of Documentation on imperavi.com website only; License holders also allowed to submit bugs and suggest features via their customer account page. For the Bug Reports and Feature Suggestions we reserve the right to solely determine best course of action: we can accept, decline or postpone any work in regards of received Bug Reports or Feature Suggestion. We give no guarantee whatsoever that we will fix any particular malfunction, and we reserve the right to determine whether Reported Bug is a malfunction or not. We don’t give any guarantee whatsoever that we will implement any of Suggested Features.

Refund Policy

Expand Down
16 changes: 16 additions & 0 deletions assets/article/plugins/bulma-content/bulma-content.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
ArticleEditor.add('plugin', 'bulma-content', {
translations: {
'en': {
"blocks": {
"content": "Content"
}
}
},
start: function() {
this.app.addbar.add('content', {
title: '## blocks.content ##',
icon: '<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m13.1428571 1c.9767326 0 1.7775055.75374093 1.8515548 1.7119471l.0055881.14519576v10.28571424c0 .9772796-.7542618 1.7775576-1.7120215 1.8515585l-.1451214.0055844h-10.28571424c-.97673257 0-1.77750547-.7537409-1.85155474-1.7119471l-.00558812-.1451958v-10.28571424c0-.97727951.75426183-1.77755756 1.71202152-1.85155846l.14512134-.0055844zm-.1428571 2h-10v10h10zm-4 6c.55228475 0 1 .44771525 1 1 0 .5522847-.44771525 1-1 1h-4c-.55228475 0-1-.4477153-1-1 0-.55228475.44771525-1 1-1zm2-4c.5522847 0 1 .44771525 1 1s-.4477153 1-1 1h-6c-.55228475 0-1-.44771525-1-1s.44771525-1 1-1z"/></svg>',
command: 'block.add'
});
}
});
2 changes: 1 addition & 1 deletion assets/article/plugins/buttonlink/buttonlink.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions assets/article/plugins/carousel/carousel.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
.arx-popup-slideshow .arx-popup-body,
.arx-popup-stack-slideshow .arx-popup-body {
padding: 20px;
padding-top: 0;
}
.arx-popup-slideshow .arx-slideshow-items {
display: flex;
flex-wrap: wrap;
padding: 20px;
padding-bottom: 10px;
margin-bottom: 10px;
background-color: #E5E7E7;
}
.arx-popup-slideshow .arx-slideshow-items:empty {
padding: 0;
margin-top: -10px;
}
.arx-popup-slideshow .arx-slideshow-items img {
max-height: 100px;
margin-right: 10px;
margin-bottom: 5px;
}
.arx-popup-slideshow .arx-slideshow-item {
position: relative;
}
.arx-popup-slideshow .arx-upload-remove {
right: 5px;
}
195 changes: 195 additions & 0 deletions assets/article/plugins/carousel/carousel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,195 @@
ArticleEditor.add('plugin', 'carousel', {
translations: {
en: {
"carousel": {
"carousel": "Carousel",
"save": "Save",
"cancel": "Cancel",
"insert": "Insert"
}
}
},
defaults: {
upload: false,
select: false,
name: 'file',
data: false,
multiple: true
},
popups: {
add: {
title: '## carousel.carousel ##',
width: '100%',
footer: {
insert: { title: '## carousel.insert ##', command: 'carousel.insert', type: 'primary' },
cancel: { title: '## carousel.cancel ##', command: 'popup.close' }
}
},
edit: {
title: '## carousel.carousel ##',
width: '100%',
footer: {
save: { title: '## carousel.save ##', command: 'carousel.save', type: 'primary' },
cancel: { title: '## carousel.cancel ##', command: 'popup.close' }
}
}
},
start: function() {
this.app.addbar.add('carousel', {
title: '## carousel.carousel ##',
icon: '<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m1 6c.51283584 0 .93550716.38604019.99327227.88337887l.00672773.11662113v6c0 .4964612.44481521.9373059 1.049825.9938787l.13199318.0061213h5.81818182c.55228475 0 1 .4477153 1 1 0 .5128358-.38604019.9355072-.88337887.9932723l-.11662113.0067277h-5.81818182c-1.67882337 0-3.08194674-1.2331302-3.17671765-2.8277989l-.00510053-.1722011v-6c0-.55228475.44771525-1 1-1zm12.6-6c1.3254834 0 2.4 1.0745166 2.4 2.4v8.2c0 .0812991-.0040424.161654-.0119371.2408747.04537.286293-.0350323.5849432-.229131.8106316-.3901386.7980655-1.2102555 1.3484937-2.1589319 1.3484937h-8.2c-.0093721 0-.01873166-.0000537-.02807838-.0001609l-.37192162.0001604c-.26521649 0-.5195704-.1053563-.70710678-.2928927l.05843073.052268c-.4838201-.2353989-.8766931-.6286113-1.11166129-1.1126794-.19291421-.2239005-.27189946-.5180346-.2277519-.8010756-.00769603-.0805757-.01191076-.1626056-.01191076-.2456198v-8.2c0-1.3254834 1.0745166-2.4 2.4-2.4zm-1.596 8.632-.76.937.839 1.431h1.517c.0486011 0 .0951777-.0086678.1382683-.0245418zm-4.582-1.631-2.176 3.83.169.169h4.349l-.436-.744-.04995732-.0453903c-.12825052-.1334488-.2131256-.2958557-.25256531-.46760617zm6.178-5.001h-8.2c-.2209139 0-.4.1790861-.4.4v4.814l1.53963435-2.70800941c.35805102-.6301698 1.23187816-.67285287 1.65793101-.12170559l.07440231.11030062 1.89203233 3.23141438 1.0987033-1.35538405c.384092-.47423473 1.0895396-.491008 1.4981306-.06381668l.0827862.09833145 1.1563799 1.56386928v-5.569c0-.19329966-.1371128-.35457492-.319386-.39187342z"/></svg>',
command: 'carousel.popup'
});
},
popup: function() {
// create
var stack = this.app.popup.add('slideshow', this.popups.add);

// body
var $body = stack.getBody();

// box
this.$box = this.dom('<div>').addClass(this.prefix + '-slideshow-items');
$body.append(this.$box);

// upload
this.$upload = this.app.image.createUploadBox(this.opts.carousel.upload, $body);

// select box
this.app.image.createSelectBox(this.opts.carousel.select, $body, 'carousel.insertFromSelect');

// open
stack.open();

// build upload
this._buildUpload(this.$upload, 'carousel.insertByUpload');
},
edit: function(params, button) {
// create
var stack = this.app.popup.create('slideshow', this.popups.edit);

// body
var $body = stack.getBody();

// data
var current = this.app.block.get();
var $block = current.getBlock();
var $elms = $block.find('img');

// box
this.$box = this.dom('<div>').addClass(this.prefix + '-slideshow-items');
$body.append(this.$box);

// items
$elms.each(function($node) {
this._buildBoxItem($node.attr('src'));
}.bind(this));

// upload
this.$upload = this.app.image.createUploadBox(this.opts.carousel.upload, $body);

// select box
this.app.image.createSelectBox(this.opts.carousel.select, $body, 'carousel.insertFromSelect');

// open
this.app.popup.open({ button: button });

// build upload
this._buildUpload(this.$upload, 'carousel.insertByUpload');
},
insertByUpload: function(response) {
for (var key in response) {
this._buildBoxItem(response[key].url);
}
},
insertFromSelect: function(e) {
e.preventDefault();

var $target = this.dom(e.target);
this._buildBoxItem($target.attr('data-url'));
},
insert: function() {
// instance
var instance = this.app.create('block.bs-carousel');
this.app.block.add({ instance: instance });

// save
this.save();
},
save: function() {
var current = this.app.block.get();
var $elms = this.$box.find('img');

if ($elms.length === 0) {
current.remove();
this.app.popup.close();
return;
}

var $block = current.getBlock();
var $inner = $block.find('.carousel-inner');

// indicators
var $indicators = $block.find('.carousel-indicators');
var blockId = current.getId();

// clear
$indicators.html('');
$inner.html('');

$elms.each(function($node, i) {
var src = $node.attr('src');

var $item = this.dom('<div>').addClass('carousel-item');
var $img = this.dom('<img>').addClass('d-block w-100').attr('src', src);
var $indicator = this.dom('<li>').attr({ 'data-slide-to': i, 'data-target': '#' + blockId });

$item.append($img);
$inner.append($item);
$indicators.append($indicator);


}.bind(this));

$inner.find('.carousel-item').first().addClass('active');
$indicators.find('li').first().addClass('active');

// close popup
this.app.popup.close();
},

// private
_removeItem: function(e) {
var $target = this.dom(e.target).closest('.' + this.prefix + '-slideshow-item');
$target.fadeOut(function($node) {
$node.remove();
}.bind(this));
},
_buildBoxItem: function(src) {
var $item = this.dom('<span>').addClass(this.prefix + '-slideshow-item');
var $remover = this.dom('<span>').addClass(this.prefix + '-upload-remove');
var $img = this.dom('<img>').attr('src', src);

$remover.one('click', this._removeItem.bind(this));

$item.append($img);
$item.append($remover);
this.$box.append($item);
},
_buildUpload: function($item, callback) {
if (!this.opts.carousel.upload) return;

var params = {
box: true,
placeholder: this.lang.get('image.upload-new-placeholder'),
url: this.opts.carousel.upload,
name: this.opts.carousel.name,
data: this.opts.carousel.data,
multiple: this.opts.carousel.multiple,
success: callback,
error: 'image.error'
};

this.app.create('upload', $item, params);
}
});
1 change: 1 addition & 0 deletions assets/article/plugins/carousel/carousel.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit ff5b6d0

Please sign in to comment.