Skip to content

Commit

Permalink
Switch to Fomantic-UI (#3)
Browse files Browse the repository at this point in the history
* removed semantic ui

* installed Fomantic-UI

* version bump

* updated readme file

* eslint + prettier
  • Loading branch information
skydiver committed Jul 19, 2019
1 parent 45cf1ab commit 89272a1
Show file tree
Hide file tree
Showing 195 changed files with 24,992 additions and 15,166 deletions.
64 changes: 13 additions & 51 deletions .semantic/gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,72 +1,34 @@
/*******************************
Set-up
*******************************/
* Set-up
*******************************/

var
gulp = require('gulp-help')(require('gulp')),
gulp = require('gulp'),

// read user config to know what task to load
config = require('./tasks/config/user'),

// watch changes
watch = require('./tasks/watch'),

// build all files
build = require('./tasks/build'),
buildJS = require('./tasks/build/javascript'),
buildCSS = require('./tasks/build/css'),
buildAssets = require('./tasks/build/assets'),

// utility
clean = require('./tasks/clean'),
version = require('./tasks/version'),

// docs tasks
serveDocs = require('./tasks/docs/serve'),
buildDocs = require('./tasks/docs/build'),

// rtl
buildRTL = require('./tasks/rtl/build'),
watchRTL = require('./tasks/rtl/watch')
config = require('./tasks/config/user')
;


/*******************************
Tasks
*******************************/
* Tasks
*******************************/

gulp.task('default', false, [
'watch'
]);
require('./tasks/collections/build')(gulp);
require('./tasks/collections/install')(gulp);

gulp.task('watch', 'Watch for site/theme changes', watch);

gulp.task('build', 'Builds all files from source', build);
gulp.task('build-javascript', 'Builds all javascript from source', buildJS);
gulp.task('build-css', 'Builds all css from source', buildCSS);
gulp.task('build-assets', 'Copies all assets from source', buildAssets);

gulp.task('clean', 'Clean dist folder', clean);
gulp.task('version', 'Displays current version of Semantic', version);
gulp.task('default', gulp.series('watch'));

/*--------------
Docs
---------------*/

/*
Lets you serve files to a local documentation instance
https://github.com/Semantic-Org/Semantic-UI-Docs/
*/

gulp.task('serve-docs', 'Serve file changes to SUI Docs', serveDocs);
gulp.task('build-docs', 'Build all files and add to SUI Docs', buildDocs);

require('./tasks/collections/docs')(gulp);

/*--------------
RTL
---------------*/

if(config.rtl) {
gulp.task('watch-rtl', 'Watch files as RTL', watchRTL);
gulp.task('build-rtl', 'Build all files as RTL', buildRTL);
}
if (config.rtl) {
require('./tasks/collections/rtl')(gulp);
}
24 changes: 17 additions & 7 deletions .semantic/src/definitions/behaviors/api.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* # Semantic UI - API
* http://github.com/semantic-org/semantic-ui/
* # Fomantic-UI - API
* http://github.com/fomantic/Fomantic-UI/
*
*
* Released under the MIT license
Expand All @@ -12,7 +12,10 @@

'use strict';

var
$.isWindow = $.isWindow || function(obj) {
return obj != null && obj === obj.window;
};

window = (typeof window != 'undefined' && window.Math == Math)
? window
: (typeof self != 'undefined' && self.Math == Math)
Expand Down Expand Up @@ -332,6 +335,10 @@ $.api = $.fn.api = function(parameters) {
return (module.cancelled || false);
},
succesful: function() {
module.verbose('This behavior will be deleted due to typo. Use "was successful" instead.');
return module.was.successful();
},
successful: function() {
return (module.request && module.request.state() == 'resolved');
},
failure: function() {
Expand Down Expand Up @@ -481,7 +488,7 @@ $.api = $.fn.api = function(parameters) {
elapsedTime = (new Date().getTime() - requestStartTime),
timeLeft = (settings.loadingDuration - elapsedTime),
translatedResponse = ( $.isFunction(settings.onResponse) )
? module.is.expectingJSON()
? module.is.expectingJSON() && !settings.rawResponse
? settings.onResponse.call(context, $.extend(true, {}, response))
: settings.onResponse.call(context, response)
: false
Expand Down Expand Up @@ -544,7 +551,7 @@ $.api = $.fn.api = function(parameters) {
response
;
// have to guess callback parameters based on request success
if( module.was.succesful() ) {
if( module.was.successful() ) {
response = firstParameter;
xhr = secondParameter;
}
Expand Down Expand Up @@ -573,7 +580,7 @@ $.api = $.fn.api = function(parameters) {
if(xhr !== undefined) {
module.debug('XHR produced a server error', status, httpMessage);
// make sure we have an error to display to console
if( xhr.status != 200 && httpMessage !== undefined && httpMessage !== '') {
if( (xhr.status < 200 || xhr.status >= 300) && httpMessage !== undefined && httpMessage !== '') {
module.error(error.statusMessage + httpMessage, ajaxSettings.url);
}
settings.onError.call(context, errorMessage, $module, xhr);
Expand Down Expand Up @@ -990,7 +997,7 @@ $.api = $.fn.api = function(parameters) {
else if(found !== undefined) {
response = found;
}
if($.isArray(returnedValue)) {
if(Array.isArray(returnedValue)) {
returnedValue.push(response);
}
else if(returnedValue !== undefined) {
Expand Down Expand Up @@ -1097,6 +1104,9 @@ $.api.settings = {
response : false,
responseAsync : false,

// whether onResponse should work with response value without force converting into an object
rawResponse : false,

// callbacks before request
beforeSend : function(settings) { return settings; },
beforeXHR : function(xhr) {},
Expand Down
Loading

0 comments on commit 89272a1

Please sign in to comment.