This repository has been archived by the owner on Apr 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 472
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This paves the way for a more modern approach in frontend development. I've also written more about how we produce the final RPM. Signed-off-by: Miquel Sabaté Solà <[email protected]>
- Loading branch information
Showing
23 changed files
with
4,353 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,30 @@ | ||
(function () { | ||
var float_alert = typeof exports !== 'undefined' && exports !== null ? exports : this; | ||
|
||
float_alert.refreshFloatAlertPosition = function () { | ||
var box = $('.float-alert'); | ||
/* eslint-disable wrap-iife, no-param-reassign */ | ||
// TODO: remove the eslint disable parts once we move to proper modules. | ||
|
||
if ($(this).scrollTop() < 60) { | ||
box.css('top', (72 - $(this).scrollTop()) + 'px'); | ||
} | ||
(function () { | ||
(function (w) { | ||
w.refreshFloatAlertPosition = function () { | ||
var box = $('.float-alert'); | ||
|
||
$(window).scroll(function scrollEvent() { | ||
if ($(this).scrollTop() > 60) { | ||
box.css('top', '12px'); | ||
} else { | ||
if ($(this).scrollTop() < 60) { | ||
box.css('top', (72 - $(this).scrollTop()) + 'px'); | ||
} | ||
}); | ||
}; | ||
|
||
float_alert.setTimeOutAlertDelay = function () { | ||
setTimeout(function () { | ||
$('.alert-hide').click(); | ||
}, 4000); | ||
}; | ||
$(w).scroll(function scrollEvent() { | ||
if ($(this).scrollTop() > 60) { | ||
box.css('top', '12px'); | ||
} else { | ||
box.css('top', (72 - $(this).scrollTop()) + 'px'); | ||
} | ||
}); | ||
}; | ||
|
||
w.setTimeOutAlertDelay = function () { | ||
setTimeout(function () { | ||
$('.alert-hide').click(); | ||
}, 4000); | ||
}; | ||
|
||
float_alert.setTimeOutAlertDelay(); | ||
}).call(this); | ||
w.setTimeOutAlertDelay(); | ||
})(window); | ||
}).call(window); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,29 @@ | ||
//= require jquery | ||
//= require jquery_ujs | ||
//= require bootstrap/transition | ||
//= require bootstrap/tab | ||
//= require bootstrap/tooltip | ||
//= require bootstrap/popover | ||
//= require lifeitup_layout | ||
//= require bootstrap-typeahead-rails | ||
//= require_tree . | ||
// jQuery | ||
window.jQuery = require('jquery'); | ||
require('jquery-ujs'); | ||
|
||
// Bootstrap | ||
require('bootstrap/js/transition'); | ||
require('bootstrap/js/tab'); | ||
require('bootstrap/js/tooltip'); | ||
require('bootstrap/js/popover'); | ||
|
||
// Life it up | ||
require('vendor/lifeitup_layout'); | ||
|
||
// NOTE: should be removed in the future | ||
require('vendor/bootstrap-typeahead'); | ||
|
||
// Require tree. | ||
// NOTE: This should be moved into proper modules. | ||
require('./alert'); | ||
require('./auth/cover'); | ||
require('./auth/registrations'); | ||
require('./bootstrap'); | ||
require('./dashboard'); | ||
require('./includes/open_close_icon'); | ||
require('./includes/set_typehead'); | ||
require('./namespaces'); | ||
require('./open_search'); | ||
require('./repositories'); | ||
require('./teams'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,16 @@ | ||
(function () { | ||
var open_close_icon = typeof exports !== 'undefined' && exports !== null ? exports : this; | ||
/* eslint-disable wrap-iife, no-param-reassign */ | ||
// TODO: remove the eslint disable parts once we move to proper modules. | ||
|
||
open_close_icon.open_close_icon = function (icon) { | ||
if (icon.hasClass('fa-close')) { | ||
icon.removeClass('fa-close'); | ||
icon.addClass('fa-pencil'); | ||
} else { | ||
icon.removeClass('fa-pencil'); | ||
icon.addClass('fa-close'); | ||
} | ||
}; | ||
}).call(this); | ||
(function () { | ||
(function (w) { | ||
w.open_close_icon = function (icon) { | ||
if (icon.hasClass('fa-close')) { | ||
icon.removeClass('fa-close'); | ||
icon.addClass('fa-pencil'); | ||
} else { | ||
icon.removeClass('fa-pencil'); | ||
icon.addClass('fa-close'); | ||
} | ||
}; | ||
})(window); | ||
}).call(window); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,26 @@ | ||
/* eslint-disable wrap-iife, no-param-reassign */ | ||
// TODO: remove the eslint disable parts once we move to proper modules. | ||
|
||
(function () { | ||
var set_typehead = typeof exports !== 'undefined' && exports !== null ? exports : this; | ||
var bloodhound; | ||
(function (w) { | ||
var bloodhound; | ||
|
||
set_typehead.set_typeahead = function (url) { | ||
$('.remote .typeahead').typeahead('destroy'); | ||
bloodhound = new Bloodhound({ | ||
datumTokenizer: Bloodhound.tokenizers.obj.whitespace('name'), | ||
queryTokenizer: Bloodhound.tokenizers.whitespace, | ||
remote: { | ||
cache: false, | ||
url: url, | ||
wildcard: '%QUERY', | ||
}, | ||
}); | ||
bloodhound.initialize(); | ||
$('.remote .typeahead').typeahead({ highlight: true }, { | ||
displayKey: 'name', | ||
source: bloodhound.ttAdapter(), | ||
}); | ||
}; | ||
}).call(this); | ||
w.set_typeahead = function (url) { | ||
$('.remote .typeahead').typeahead('destroy'); | ||
bloodhound = new Bloodhound({ | ||
datumTokenizer: Bloodhound.tokenizers.obj.whitespace('name'), | ||
queryTokenizer: Bloodhound.tokenizers.whitespace, | ||
remote: { | ||
cache: false, | ||
url: url, | ||
wildcard: '%QUERY', | ||
}, | ||
}); | ||
bloodhound.initialize(); | ||
$('.remote .typeahead').typeahead({ highlight: true }, { | ||
displayKey: 'name', | ||
source: bloodhound.ttAdapter(), | ||
}); | ||
}; | ||
})(window); | ||
}).call(window); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.