Skip to content

Commit 9c54d66

Browse files
Big Fixes
1 parent 1cfdaa2 commit 9c54d66

File tree

8 files changed

+128
-23
lines changed

8 files changed

+128
-23
lines changed

astroid/astroid-framework/assets/css/astroid-framework.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

astroid/astroid-framework/assets/css/astroid-framework.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

astroid/astroid-framework/assets/js/astroid-framework.js

Lines changed: 106 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ astroidFramework.directive("astroidmediagallery", ["$http", function ($http) {
2020
$scope.gallery = {};
2121
$scope.back = "";
2222
$scope.folder = "";
23-
$scope.MEDIA_URL = SITE_URL + $scope.Imgpath +"/";
23+
$scope.MEDIA_URL = SITE_URL + $scope.Imgpath + "/";
2424
$scope.iconsize = 130;
2525
$scope.getImageUrl = function () {
2626
if (ngModel.$modelValue == "" || typeof ngModel.$modelValue == "undefined") {
@@ -132,6 +132,111 @@ astroidFramework.directive("astroidmediagallery", ["$http", function ($http) {
132132
}
133133
}
134134
}]);
135+
136+
astroidFramework.directive("astroidspacing", ["$http", function ($http) {
137+
return {
138+
restrict: "A",
139+
scope: true,
140+
require: "ngModel",
141+
link: function ($scope, $element, $attrs, ngModel) {
142+
143+
var _value = {
144+
'desktop': {
145+
'top': null,
146+
'right': null,
147+
'left': null,
148+
'bottom': null,
149+
'lock': false,
150+
'unit': 'px',
151+
},
152+
'tablet': {
153+
'top': null,
154+
'right': null,
155+
'left': null,
156+
'bottom': null,
157+
'lock': false,
158+
'unit': 'px'
159+
},
160+
'mobile': {
161+
'top': null,
162+
'right': null,
163+
'left': null,
164+
'bottom': null,
165+
'lock': false,
166+
'unit': 'px'
167+
}
168+
};
169+
170+
setTimeout(function () {
171+
var _val = {};
172+
if (ngModel.$modelValue != NaN && ngModel.$modelValue != '' && ngModel.$modelValue != null) {
173+
try {
174+
_val = JSON.parse(ngModel.$modelValue);
175+
} catch (e) {
176+
_val = {};
177+
}
178+
}
179+
180+
$.extend(_value, _val);
181+
$element.find('textarea').val(JSON.stringify(_value));
182+
183+
['desktop', 'tablet', 'mobile'].forEach(function (_device) {
184+
['top', 'right', 'bottom', 'left', 'unit'].forEach(function (_prop) {
185+
$element.find('[data-device=' + _device + '][data-attr=' + _prop + ']').val(_value[_device][_prop]);
186+
});
187+
});
188+
189+
}, 100);
190+
191+
$scope.updateInput = function (_input) {
192+
var _device = _input.data('device');
193+
var _attr = _input.data('attr');
194+
_value[_device][_attr] = _input.val();
195+
if (_attr == 'top' && _value[_device].lock) {
196+
var _topVal = _value[_device][_attr];
197+
['right', 'bottom', 'left', 'unit'].forEach(function (_prop) {
198+
$element.find('input[data-device=' + _device + '][data-attr=' + _prop + ']').val(_topVal);
199+
});
200+
}
201+
$element.find('textarea').val(JSON.stringify(_value));
202+
}
203+
204+
$element.find('input').bind('change', function () {
205+
$scope.updateInput($(this));
206+
});
207+
208+
$element.find('input').bind('input', function () {
209+
$scope.updateInput($(this));
210+
});
211+
212+
$element.find('select').bind('change', function () {
213+
$scope.updateInput($(this));
214+
});
215+
216+
$scope.switchLock = function (_device) {
217+
_value[_device].lock = !_value[_device].lock;
218+
$element.find('textarea').val(JSON.stringify(_value));
219+
$scope.updateLock(_device);
220+
}
221+
222+
$scope.updateLock = function (_device) {
223+
if (_value[_device].lock) {
224+
var _topVal = $element.find('input[data-device=' + _device + '][data-attr=top]').val();
225+
['right', 'bottom', 'left', 'unit'].forEach(function (_prop) {
226+
$element.find('input[data-device=' + _device + '][data-attr=' + _prop + ']').val(_topVal);
227+
$element.find('input[data-device=' + _device + '][data-attr=' + _prop + ']').prop('disabled', true);
228+
});
229+
$element.find('input[data-device=' + _device + '][data-attr=top]').focus();
230+
} else {
231+
['right', 'bottom', 'left', 'unit'].forEach(function (_prop) {
232+
$element.find('input[data-device=' + _device + '][data-attr=' + _prop + ']').prop('disabled', false);
233+
});
234+
}
235+
}
236+
}
237+
}
238+
}]);
239+
135240
astroidFramework.directive("astroidsocialprofiles", ["$http", function ($http) {
136241
return {
137242
restrict: "A",

astroid/astroid-framework/assets/js/astroid.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

astroid/astroid-framework/framework/article.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,6 @@ public static function getVideoId($url, $type)
477477
{
478478
$parts = parse_url($url);
479479
if ($type == "youtube") {
480-
return (isset($parts['path']) ? $parts['path'] : '');
481480
parse_str($parts['query'], $query);
482481
return (isset($query['v']) ? $query['v'] : '');
483482
} else {

astroid/astroid-framework/framework/forms/banner.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@
1515
</field>
1616
<field showon="astroid_banner_title_enabled:1[AND]astroid_banner_enabled:1" name="astroid_banner_subtitle" type="text" label="ASTROID_BANNER_SUBTITLE_LABEL">
1717
</field>
18-
<field showon="astroid_banner_enabled:1" name="astroid_banner_textcolor" type="color" label="TPL_ASTROID_TEXT_COLOR_LABEL">
18+
<field name="astroid_banner_textcolor" type="color" showon="astroid_banner_title_enabled:1[AND]astroid_banner_enabled:1" label="TPL_ASTROID_TEXT_COLOR_LABEL">
1919
</field>
2020
<field showon="astroid_banner_enabled:1" name="astroid_banner_bgcolor" type="color" label="TPL_ASTROID_BACKGROUND_COLOR_LABEL">
2121
</field>
2222
<field showon="astroid_banner_enabled:1" name="astroid_banner_bgimage" type="media" label="TPL_ASTROID_BACKGROUND_IMAGE_LABEL">
2323
</field>
24-
<field showon="astroid_banner_enabled:1" name="astroid_banner_title_tag" type="headertag" default="h3" label="ASTROID_BANNER_TITLE_TAG_LABEL">
24+
<field showon="astroid_banner_title_enabled:1[AND]astroid_banner_enabled:1" name="astroid_banner_title_tag" type="headertag" default="h3" label="ASTROID_BANNER_TITLE_TAG_LABEL">
2525
</field>
2626
<field showon="astroid_banner_enabled:1" name="astroid_banner_class" type="text" label="ASTROID_BANNER_CLASS_LABEL">
2727
</field>

astroid/astroid-framework/framework/forms/blog.xml

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,45 +2,50 @@
22
<form>
33
<fields name="attribs">
44
<fieldset label="ASTROID_ARTICLE_BLOG_OPTIONS_TITLE_LABEL" name="articleblogoptions">
5-
<field type="radio" name="astroid_relatedposts" label="ASTROID_RELATED_POSTS" class="btn-group" default="">
5+
<field type="radio" name="astroid_authorinfo" label="ASTROID_AUTHOR_INFO" class="btn-group" default="">
66
<option value="">JGLOBAL_INHERIT</option>
77
<option value="1">ASTROID_SHOW</option>
88
<option value="0">ASTROID_HIDE</option>
99
</field>
1010

11-
<field type="radio" name="article_relatedposts_count" label="ASTROID_RELATED_POSTS" class="btn-group" default="" showon="astroid_relatedposts:1">
11+
<field type="radio" name="article_rating" label="ASTROID_ARTICLE_RATING" class="btn-group" default="">
1212
<option value="">JGLOBAL_INHERIT</option>
13-
<option value="1">Custom</option>
14-
</field>
15-
16-
<field type="number" name="article_relatedposts_count_custom" label="ASTROID_BLANK_LBL" showon="astroid_relatedposts:1[AND]article_relatedposts_count:1" default="4">
13+
<option value="1">ASTROID_SHOW</option>
14+
<option value="0">ASTROID_HIDE</option>
1715
</field>
1816

19-
<field type="radio" name="astroid_socialshare" label="ASTROID_SOCIAL_SHARE" class="btn-group" default="">
17+
<field type="radio" name="astroid_relatedposts" label="ASTROID_RELATED_POSTS" class="btn-group" default="">
2018
<option value="">JGLOBAL_INHERIT</option>
2119
<option value="1">ASTROID_SHOW</option>
2220
<option value="0">ASTROID_HIDE</option>
2321
</field>
24-
<field type="radio" name="astroid_comments" label="ASTROID_COMMENTS" class="btn-group" default="">
22+
23+
<field type="radio" name="article_relatedposts_count" label="ASTROID_RELATED_POSTS" class="btn-group" default="" showon="astroid_relatedposts:1">
2524
<option value="">JGLOBAL_INHERIT</option>
26-
<option value="1">ASTROID_SHOW</option>
27-
<option value="0">ASTROID_HIDE</option>
25+
<option value="1">Custom</option>
2826
</field>
27+
28+
<field type="number" name="article_relatedposts_count_custom" label="ASTROID_BLANK_LBL" showon="astroid_relatedposts:1[AND]article_relatedposts_count:1" default="4">
29+
</field>
30+
2931
<field type="radio" name="astroid_readtime" label="ASTROID_READ_TIME" class="btn-group" default="">
3032
<option value="">JGLOBAL_INHERIT</option>
3133
<option value="1">ASTROID_SHOW</option>
3234
<option value="0">ASTROID_HIDE</option>
3335
</field>
34-
<field type="radio" name="astroid_authorinfo" label="ASTROID_AUTHOR_INFO" class="btn-group" default="">
36+
37+
<field type="radio" name="astroid_socialshare" label="ASTROID_SOCIAL_SHARE" class="btn-group" default="">
3538
<option value="">JGLOBAL_INHERIT</option>
3639
<option value="1">ASTROID_SHOW</option>
3740
<option value="0">ASTROID_HIDE</option>
3841
</field>
39-
<field type="radio" name="article_rating" label="ASTROID_ARTICLE_RATING" class="btn-group" default="">
42+
43+
<field type="radio" name="astroid_comments" label="ASTROID_COMMENTS" class="btn-group" default="">
4044
<option value="">JGLOBAL_INHERIT</option>
4145
<option value="1">ASTROID_SHOW</option>
4246
<option value="0">ASTROID_HIDE</option>
4347
</field>
48+
4449
</fieldset>
4550
</fields>
4651
</form>

astroid/astroid-template-zero/frontend/blog/modules/badge.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@
1515

1616
$article = $params['article'];
1717
$params = $article->params;
18-
$badge = $params->get('astroid_article_badge', 0);
19-
if (!$badge) {
20-
return;
21-
}
2218
$type = $params->get('astroid_article_badge_type', 2);
2319
if ($type != 1) {
2420
?>

0 commit comments

Comments
 (0)