Skip to content

Commit 2bd6664

Browse files
authored
Merge pull request #5 from AndreiMotinga/master
Fix npm install
2 parents 491710f + b6ddcbd commit 2bd6664

Some content is hidden

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

84 files changed

+10312
-862
lines changed

Gemfile

+3-14
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,11 @@ gem 'sdoc', '~> 0.4.0', group: :doc
2525

2626
gem 'foreman', '~> 0.82.0'
2727

28-
# Use ActiveModel has_secure_password
29-
# gem 'bcrypt', '~> 3.1.7'
30-
31-
# Use Unicorn as the app server
32-
# gem 'unicorn'
33-
34-
# Use Capistrano for deployment
35-
# gem 'capistrano-rails', group: :development
28+
group :development do
29+
gem 'web-console', '~> 2.0'
30+
end
3631

3732
group :development, :test do
38-
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
3933
gem 'byebug'
40-
41-
# Access an IRB console on exception pages or by using <%= console %> in views
42-
gem 'web-console', '~> 2.0'
43-
44-
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
4534
gem 'spring'
4635
end

client/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"babel-plugin-transform-class-properties": "6.22.0",
1313
"react": "15.4.0",
1414
"react-dom": "15.4.0",
15-
"semantic-ui": "2.2.7"
15+
"semantic-ui": "2.2.10"
1616
},
1717
"scripts": {
1818
"start": "react-scripts start",

client/semantic.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@
1818
"permission": false,
1919
"autoInstall": false,
2020
"rtl": false,
21-
"version": "2.2.7"
21+
"version": "2.2.10"
2222
}

client/semantic/gulpfile.js

100755100644
File mode changed.

client/semantic/src/definitions/behaviors/form.js

+67-19
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ $.fn.form = function(parameters) {
5757
metadata,
5858
selector,
5959
className,
60+
regExp,
6061
error,
6162

6263
namespace,
@@ -233,6 +234,20 @@ $.fn.form = function(parameters) {
233234
;
234235
},
235236

237+
determine: {
238+
isValid: function() {
239+
var
240+
allValid = true
241+
;
242+
$.each(validation, function(fieldName, field) {
243+
if( !( module.validate.field(field, fieldName, true) ) ) {
244+
allValid = false;
245+
}
246+
});
247+
return allValid;
248+
}
249+
},
250+
236251
is: {
237252
bracketedRule: function(rule) {
238253
return (rule.type && rule.type.match(settings.regExp.bracket));
@@ -251,17 +266,23 @@ $.fn.form = function(parameters) {
251266
blank: function($field) {
252267
return $.trim($field.val()) === '';
253268
},
254-
valid: function() {
269+
valid: function(field) {
255270
var
256271
allValid = true
257272
;
258-
module.verbose('Checking if form is valid');
259-
$.each(validation, function(fieldName, field) {
260-
if( !( module.validate.field(field, fieldName) ) ) {
261-
allValid = false;
262-
}
263-
});
264-
return allValid;
273+
if(field) {
274+
module.verbose('Checking if field is valid', field);
275+
return module.validate.field(validation[field], field, false);
276+
}
277+
else {
278+
module.verbose('Checking if form is valid');
279+
$.each(validation, function(fieldName, field) {
280+
if( !module.is.valid(fieldName) ) {
281+
allValid = false;
282+
}
283+
});
284+
return allValid;
285+
}
265286
}
266287
},
267288

@@ -338,7 +359,7 @@ $.fn.form = function(parameters) {
338359
$fieldGroup = $field.closest($group),
339360
validationRules = module.get.validation($field)
340361
;
341-
if(settings.on == 'change' || ( $fieldGroup.hasClass(className.error) && settings.revalidate) ) {
362+
if(validationRules && (settings.on == 'change' || ( $fieldGroup.hasClass(className.error) && settings.revalidate) )) {
342363
clearTimeout(module.timer);
343364
module.timer = setTimeout(function() {
344365
module.debug('Revalidating field', $field, module.get.validation($field));
@@ -465,6 +486,7 @@ $.fn.form = function(parameters) {
465486
metadata = settings.metadata;
466487
selector = settings.selector;
467488
className = settings.className;
489+
regExp = settings.regExp;
468490
error = settings.error;
469491
moduleNamespace = 'module-' + namespace;
470492
eventNamespace = '.' + namespace;
@@ -477,7 +499,8 @@ $.fn.form = function(parameters) {
477499
},
478500
field: function(identifier) {
479501
module.verbose('Finding field with identifier', identifier);
480-
if( $field.filter('#' + identifier).length > 0 ) {
502+
identifier = module.escape.string(identifier);
503+
if($field.filter('#' + identifier).length > 0 ) {
481504
return $field.filter('#' + identifier);
482505
}
483506
else if( $field.filter('[name="' + identifier +'"]').length > 0 ) {
@@ -592,10 +615,11 @@ $.fn.form = function(parameters) {
592615

593616
field: function(identifier) {
594617
module.verbose('Checking for existence of a field with identifier', identifier);
618+
identifier = module.escape.string(identifier);
595619
if(typeof identifier !== 'string') {
596620
module.error(error.identifier, identifier);
597621
}
598-
if( $field.filter('#' + identifier).length > 0 ) {
622+
if($field.filter('#' + identifier).length > 0 ) {
599623
return true;
600624
}
601625
else if( $field.filter('[name="' + identifier +'"]').length > 0 ) {
@@ -609,6 +633,13 @@ $.fn.form = function(parameters) {
609633

610634
},
611635

636+
escape: {
637+
string: function(text) {
638+
text = String(text);
639+
return text.replace(regExp.escape, '\\$&');
640+
}
641+
},
642+
612643
add: {
613644
prompt: function(identifier, errors) {
614645
var
@@ -794,7 +825,7 @@ $.fn.form = function(parameters) {
794825

795826
// reset errors
796827
formErrors = [];
797-
if( module.is.valid() ) {
828+
if( module.determine.isValid() ) {
798829
module.debug('Form has no validation errors, submitting');
799830
module.set.success();
800831
if(ignoreCallbacks !== true) {
@@ -818,7 +849,16 @@ $.fn.form = function(parameters) {
818849
},
819850

820851
// takes a validation object and returns whether field passes validation
821-
field: function(field, fieldName) {
852+
field: function(field, fieldName, showErrors) {
853+
showErrors = (showErrors !== undefined)
854+
? showErrors
855+
: true
856+
;
857+
if(typeof field == 'string') {
858+
module.verbose('Validating field', field);
859+
fieldName = field;
860+
field = validation[field];
861+
}
822862
var
823863
identifier = field.identifier || fieldName,
824864
$field = module.get.field(identifier),
@@ -854,13 +894,17 @@ $.fn.form = function(parameters) {
854894
});
855895
}
856896
if(fieldValid) {
857-
module.remove.prompt(identifier, fieldErrors);
858-
settings.onValid.call($field);
897+
if(showErrors) {
898+
module.remove.prompt(identifier, fieldErrors);
899+
settings.onValid.call($field);
900+
}
859901
}
860902
else {
861-
formErrors = formErrors.concat(fieldErrors);
862-
module.add.prompt(identifier, fieldErrors);
863-
settings.onInvalid.call($field, fieldErrors);
903+
if(showErrors) {
904+
formErrors = formErrors.concat(fieldErrors);
905+
module.add.prompt(identifier, fieldErrors);
906+
settings.onInvalid.call($field, fieldErrors);
907+
}
864908
return false;
865909
}
866910
return true;
@@ -1090,8 +1134,9 @@ $.fn.form.settings = {
10901134
},
10911135

10921136
regExp: {
1137+
htmlID : /^[a-zA-Z][\w:.-]*$/g,
10931138
bracket : /\[(.*)\]/i,
1094-
decimal : /^\d*(\.)\d+/,
1139+
decimal : /^\d+\.?\d*$/,
10951140
email : /^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i,
10961141
escape : /[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,
10971142
flags : /^\/(.*)\/(.*)?/,
@@ -1475,6 +1520,9 @@ $.fn.form.settings = {
14751520
return;
14761521
}
14771522

1523+
// allow dashes in card
1524+
cardNumber = cardNumber.replace(/[\-]/g, '');
1525+
14781526
// verify card types
14791527
if(requiredTypes) {
14801528
$.each(requiredTypes, function(index, type){

client/semantic/src/definitions/behaviors/visibility.js

+32-4
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,11 @@ $.fn.visibility = function(parameters) {
387387
.attr('src', src)
388388
;
389389
if(settings.transition) {
390-
if( $.fn.transition !== undefined ) {
390+
if( $.fn.transition !== undefined) {
391+
if($module.hasClass(className.visible)) {
392+
module.debug('Transition already occurred on this image, skipping animation');
393+
return;
394+
}
391395
$module.transition(settings.transition, settings.duration, callback);
392396
}
393397
else {
@@ -418,6 +422,22 @@ $.fn.visibility = function(parameters) {
418422
return !(module.cache.element.width === 0 && module.cache.element.offset.top === 0);
419423
}
420424
return false;
425+
},
426+
verticallyScrollableContext: function() {
427+
var
428+
overflowY = ($context.get(0) !== window)
429+
? $context.css('overflow-y')
430+
: false
431+
;
432+
return (overflowY == 'auto' || overflowY == 'scroll');
433+
},
434+
horizontallyScrollableContext: function() {
435+
var
436+
overflowX = ($context.get(0) !== window)
437+
? $context.css('overflow-x')
438+
: false
439+
;
440+
return (overflowX == 'auto' || overflowX == 'scroll');
421441
}
422442
},
423443

@@ -875,6 +895,13 @@ $.fn.visibility = function(parameters) {
875895
element.offset = $module.offset();
876896
element.width = $module.outerWidth();
877897
element.height = $module.outerHeight();
898+
// compensate for scroll in context
899+
if(module.is.verticallyScrollableContext()) {
900+
element.offset.top += $context.scrollTop() - $context.offset().top;
901+
}
902+
if(module.is.horizontallyScrollableContext()) {
903+
element.offset.left += $context.scrollLeft - $context.offset().left;
904+
}
878905
// store
879906
module.cache.element = element;
880907
return element;
@@ -898,10 +925,10 @@ $.fn.visibility = function(parameters) {
898925
}
899926

900927
// visibility
901-
element.topVisible = (screen.bottom >= element.top);
902928
element.topPassed = (screen.top >= element.top);
903-
element.bottomVisible = (screen.bottom >= element.bottom);
904929
element.bottomPassed = (screen.top >= element.bottom);
930+
element.topVisible = (screen.bottom >= element.top) && !element.bottomPassed;
931+
element.bottomVisible = (screen.bottom >= element.bottom) && !element.topPassed;
905932
element.pixelsPassed = 0;
906933
element.percentagePassed = 0;
907934

@@ -1270,7 +1297,8 @@ $.fn.visibility.settings = {
12701297

12711298
className: {
12721299
fixed : 'fixed',
1273-
placeholder : 'placeholder'
1300+
placeholder : 'placeholder',
1301+
visible : 'visible'
12741302
},
12751303

12761304
error : {

client/semantic/src/definitions/elements/button.less

+2-3
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,7 @@
693693
.ui.icon.buttons .button > .icon,
694694
.ui.icon.button > .icon {
695695
opacity: @iconButtonOpacity;
696-
margin: 0em;
696+
margin: 0em !important;
697697
vertical-align: top;
698698
}
699699

@@ -744,7 +744,6 @@
744744
background: @basicActiveBackground !important;
745745
box-shadow: @basicActiveBoxShadow !important;
746746
color: @basicActiveTextColor;
747-
box-shadow: @selectedBorderColor;
748747
}
749748
.ui.basic.buttons .active.button:hover,
750749
.ui.basic.active.button:hover {
@@ -759,7 +758,7 @@
759758
box-shadow: @basicDownBoxShadow inset;
760759
}
761760
.ui.basic.buttons .active.button {
762-
box-shadow: @selectedBorderColor inset;
761+
box-shadow: @basicActiveBoxShadow !important;
763762
}
764763

765764
/* Standard Basic Inverted */

client/semantic/src/definitions/elements/header.less

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,15 @@
7979
Image
8080
--------------------*/
8181

82-
.ui.header > .image,
82+
.ui.header > .image:not(.icon),
8383
.ui.header > img {
8484
display: inline-block;
8585
margin-top: @imageOffset;
8686
width: @imageWidth;
8787
height: @imageHeight;
8888
vertical-align: @imageAlignment;
8989
}
90-
.ui.header > .image:only-child,
90+
.ui.header > .image:not(.icon):only-child,
9191
.ui.header > img:only-child {
9292
margin-right: @imageMargin;
9393
}

client/semantic/src/definitions/elements/segment.less

+7
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,13 @@
226226
padding: @veryPaddedSegmentPadding;
227227
}
228228

229+
/* Padded vertical */
230+
.ui.padded.segment.vertical.segment,
231+
.ui[class*="very padded"].vertical.segment {
232+
padding-left: 0px;
233+
padding-right: 0px;
234+
}
235+
229236
/*-------------------
230237
Compact
231238
--------------------*/

0 commit comments

Comments
 (0)