Skip to content

Commit c9ac40d

Browse files
committed
Initial Commit
1 parent 3e6ff10 commit c9ac40d

71 files changed

Lines changed: 3112 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.php_cs.cache
2+
vendor/
3+
composer.lock
4+
Modules/
5+
/.project
6+
build/

.php_cs

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?php
2+
3+
$finder = Symfony\CS\Finder\DefaultFinder::create()
4+
->exclude('Modules')
5+
->exclude('vendor')
6+
->in(__DIR__)
7+
;
8+
9+
return Symfony\CS\Config\Config::create()
10+
->setUsingCache(true)
11+
->level(Symfony\CS\FixerInterface::PSR2_LEVEL)
12+
->fixers(array(
13+
// Concatenation should be used with at least one whitespace around.
14+
'concat_with_spaces',
15+
// Unused use statements must be removed.
16+
'ordered_use',
17+
// Removes extra empty lines.
18+
'extra_empty_lines',
19+
// Removes line breaks between use statements.
20+
'remove_lines_between_uses',
21+
// An empty line feed should precede a return statement.
22+
'return',
23+
// Unused use statements must be removed.
24+
'unused_use',
25+
// Remove trailing whitespace at the end of blank lines.
26+
'whitespacy_lines',
27+
// There MUST be one blank line after the namespace declaration.
28+
'line_after_namespace',
29+
// There should be exactly one blank line before a namespace declaration.
30+
'single_blank_line_before_namespace',
31+
// Each namespace use MUST go on its own line and there MUST be one blank line after the use statements block.
32+
'single_line_after_imports',
33+
// Ensure there is no code on the same line as the PHP open tag and it is followed by a blankline.
34+
'blankline_after_open_tag',
35+
// Remove duplicated semicolons.
36+
'duplicate_semicolon',
37+
// PHP multi-line arrays should have a trailing comma.
38+
'multiline_array_trailing_comma',
39+
// There should be no empty lines after class opening brace.
40+
'no_blank_lines_after_class_opening',
41+
// There should not be blank lines between docblock and the documented element.
42+
'no_empty_lines_after_phpdocs',
43+
// Phpdocs should start and end with content, excluding the very first and last line of the docblocks.
44+
'phpdoc_trim',
45+
// Removes line breaks between use statements.
46+
'remove_lines_between_uses',
47+
))
48+
->finder($finder);

.travis.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
language: php
2+
3+
php:
4+
- 7
5+
- hhvm
6+
7+
env:
8+
- LARAVEL_VERSION="~5.5" TESTBENCH_VERSION="~3.5"
9+
10+
before_script:
11+
- travis_retry composer self-update
12+
- travis_retry composer install --no-interaction --prefer-source
13+
14+
script: phpunit
15+
16+
sudo: false
17+
18+
notifications:
19+
email:
20+
- darron1217@gmail.com
21+
22+
matrix:
23+
allow_failures:
24+
- php: hhvm

Assets/css/nestable.css

Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
.dd {
2+
position: relative;
3+
display: block;
4+
margin: 0;
5+
padding: 0;
6+
list-style: none;
7+
font-size: 13px;
8+
line-height: 29px;
9+
}
10+
.dd-list {
11+
display: block;
12+
position: relative;
13+
margin: 0;
14+
padding: 0;
15+
list-style: none;
16+
}
17+
.dd-list .dd-list {
18+
padding-left: 30px;
19+
}
20+
.dd-collapsed .dd-list {
21+
display: none;
22+
}
23+
.dd-item,
24+
.dd-item-root,
25+
.dd-empty,
26+
.dd-placeholder {
27+
display: block;
28+
position: relative;
29+
margin: 0;
30+
padding: 0;
31+
min-height: 20px;
32+
font-size: 13px;
33+
line-height: 20px;
34+
}
35+
.dd-handle-root,
36+
.dd-handle {
37+
margin: 5px 0;
38+
padding: 4px 10px;
39+
color: #333;
40+
text-decoration: none;
41+
font-weight: bold;
42+
border: 1px solid #ccc;
43+
background: #fafafa;
44+
-webkit-border-radius: 3px;
45+
border-radius: 3px;
46+
box-sizing: border-box;
47+
-moz-box-sizing: border-box;
48+
}
49+
.dd-handle:hover {
50+
color: #2ea8e5;
51+
background: #fff;
52+
cursor: move;
53+
}
54+
.dd-item-root > .btn {
55+
display: none;
56+
}
57+
.dd-item-root > button,
58+
.dd-item > button {
59+
display: block;
60+
position: relative;
61+
cursor: pointer;
62+
float: right;
63+
width: 25px;
64+
height: 20px;
65+
margin: 5px 0;
66+
padding: 0;
67+
text-indent: 100%;
68+
white-space: nowrap;
69+
overflow: hidden;
70+
border: 0;
71+
background: transparent;
72+
font-size: 12px;
73+
line-height: 1;
74+
text-align: center;
75+
font-weight: bold;
76+
}
77+
.dd-item-root > button:before,
78+
.dd-item > button:before {
79+
content: '+';
80+
display: block;
81+
position: absolute;
82+
width: 100%;
83+
text-align: center;
84+
text-indent: 0;
85+
font-size: 20px;
86+
line-height: 9px;
87+
}
88+
.dd-item-root > button[data-action="collapse"]:before,
89+
.dd-item > button[data-action="collapse"]:before {
90+
content: '-';
91+
font-size: 20px;
92+
line-height: 9px;
93+
}
94+
.dd-placeholder,
95+
.dd-empty {
96+
margin: 5px 0;
97+
padding: 0;
98+
min-height: 30px;
99+
background: #f2fbff;
100+
border: 1px dashed #b6bcbf;
101+
box-sizing: border-box;
102+
-moz-box-sizing: border-box;
103+
}
104+
.dd-empty {
105+
border: 1px dashed #bbb;
106+
min-height: 100px;
107+
background-color: #e5e5e5;
108+
background-image: -webkit-linear-gradient(45deg, #ffffff 25%, transparent 25%, transparent 75%, #ffffff 75%, #ffffff), -webkit-linear-gradient(45deg, #ffffff 25%, transparent 25%, transparent 75%, #ffffff 75%, #ffffff);
109+
background-image: -moz-linear-gradient(45deg, #ffffff 25%, transparent 25%, transparent 75%, #ffffff 75%, #ffffff), -moz-linear-gradient(45deg, #ffffff 25%, transparent 25%, transparent 75%, #ffffff 75%, #ffffff);
110+
background-image: linear-gradient(45deg, #ffffff 25%, transparent 25%, transparent 75%, #ffffff 75%, #ffffff), linear-gradient(45deg, #ffffff 25%, transparent 25%, transparent 75%, #ffffff 75%, #ffffff);
111+
background-size: 60px 60px;
112+
background-position: 0 0, 30px 30px;
113+
}
114+
.dd-dragel {
115+
position: absolute;
116+
pointer-events: none;
117+
z-index: 9999;
118+
}
119+
.dd-dragel > .dd-item .dd-handle {
120+
margin-top: 0;
121+
}
122+
.dd-dragel .dd-handle {
123+
-webkit-box-shadow: 2px 4px 6px 0 rgba(0, 0, 0, 0.1);
124+
box-shadow: 2px 4px 6px 0 rgba(0, 0, 0, 0.1);
125+
}
126+
/**
127+
* Nestable Extras
128+
*/
129+
.nestable-lists {
130+
display: block;
131+
clear: both;
132+
padding: 30px 0;
133+
width: 100%;
134+
border: 0;
135+
border-top: 2px solid #ddd;
136+
border-bottom: 2px solid #ddd;
137+
}
138+
#nestable-menu {
139+
padding: 0;
140+
margin: 20px 0;
141+
}
142+
#nestable-output,
143+
#nestable2-output {
144+
width: 100%;
145+
height: 7em;
146+
font-size: 0.75em;
147+
line-height: 1.333333em;
148+
font-family: Consolas, monospace;
149+
padding: 5px;
150+
box-sizing: border-box;
151+
-moz-box-sizing: border-box;
152+
}
153+
#nestable2 .dd-handle {
154+
color: #fff;
155+
border: 1px solid #999;
156+
background: #bbb;
157+
background: -webkit-linear-gradient(top, #bbbbbb 0%, #999999 100%);
158+
background: -moz-linear-gradient(top, #bbbbbb 0%, #999999 100%);
159+
background: linear-gradient(top, #bbbbbb 0%, #999999 100%);
160+
}
161+
#nestable2 .dd-handle:hover {
162+
background: #bbb;
163+
}
164+
#nestable2 .dd-item > button:before {
165+
color: #fff;
166+
}
167+
@media only screen and (min-width: 700px) {
168+
.dd {
169+
float: left;
170+
width: 100%;
171+
}
172+
.dd + .dd {
173+
margin-left: 2%;
174+
}
175+
}
176+
.dd-hover > .dd-handle {
177+
background: #2ea8e5 !important;
178+
}

Assets/js/attributes_form.js

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
$('.selectize').selectize();
2+
$( document ).ready(function() {
3+
// $('.dd').nestable();
4+
$('.jsTypeSelection').on('change', function() {
5+
if ($(this).find(':selected').data('use-options') === 1) {
6+
cloneTemplate();
7+
$('.optionsArea').show();
8+
$('.noOptionsArea').hide();
9+
} else {
10+
$('.optionsArea').hide();
11+
$('.noOptionsArea').show();
12+
if ($('.options li').length > 1) {
13+
$('.options li:last').remove();
14+
}
15+
}
16+
});
17+
18+
var $body = $('body');
19+
20+
$body.on('change', '.jsOptionLanguage', function (event) {
21+
$(this).parent().find('.lang-group').each(function (i ,element) {
22+
$(element).hide();
23+
});
24+
$(this).parent().find('.' + $(this).val()).show();
25+
});
26+
27+
$body.on('click', '.jsAddRow', function (event) {
28+
event.preventDefault();
29+
incrementItemCount();
30+
cloneTemplate();
31+
});
32+
$body.on('click', '.jsRemoveRow', function (event) {
33+
event.preventDefault();
34+
var $row = $(this).closest('.dd-item');
35+
if ($('.options li').length > 2) {
36+
$row.fadeOut();
37+
setTimeout(function() {
38+
$row.remove();
39+
}, 300);
40+
decrementItemCount();
41+
}
42+
});
43+
44+
function cloneTemplate() {
45+
var clone = $('.jsItemTemplate').clone(),
46+
$wrapper = $('.jsOptionsWrapper');
47+
48+
$(clone).find('input').each(function() {
49+
var text = $(this).attr('name');
50+
$(this).attr('name', text.replace('count', $wrapper.data('item-count')));
51+
$(this).attr('id', text.replace('count', $wrapper.data('item-count')));
52+
});
53+
$(clone).find('label').each(function() {
54+
var text = $(this).attr('for');
55+
$(this).attr('for', text.replace('count', $wrapper.data('item-count')));
56+
});
57+
58+
clone.removeClass('jsItemTemplate').removeClass('hidden').appendTo($wrapper);
59+
}
60+
61+
function incrementItemCount() {
62+
var $wrapper = $('.jsOptionsWrapper'),
63+
currentCount = parseInt($wrapper.data('item-count'));
64+
65+
$wrapper.data('item-count', currentCount + 1)
66+
}
67+
68+
function decrementItemCount() {
69+
var $wrapper = $('.jsOptionsWrapper'),
70+
currentCount = parseInt($wrapper.data('item-count'));
71+
72+
$wrapper.data('item-count', currentCount - 1)
73+
}
74+
});
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
angular.module('app.directive.slug-only', [])
2+
.directive('slugOnly', function() {
3+
return {
4+
restrict: 'A',
5+
require: '?ngModel',
6+
link: function(scope, element, attr, ngModelCtrl) {
7+
ngModelCtrl.$parsers.push(function (inputValue) {
8+
if (inputValue == undefined) return '';
9+
var transformedInput = inputValue.replace(/[^a-z0-9-_]/g, '');
10+
if (transformedInput !== inputValue) {
11+
ngModelCtrl.$setViewValue(transformedInput);
12+
ngModelCtrl.$render();
13+
}
14+
return transformedInput;
15+
});
16+
}
17+
};
18+
});

0 commit comments

Comments
 (0)