Skip to content
This repository has been archived by the owner on May 6, 2022. It is now read-only.

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
polupraneeth committed Jan 31, 2020
2 parents 262f498 + 307bd22 commit 5d5f563
Show file tree
Hide file tree
Showing 9 changed files with 157 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ ocular.phar
phpunit.xml

# Composer
vendor
!/vendor/

# General
NOTES.md
11 changes: 11 additions & 0 deletions assets/css/vendor/animate.min.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions assets/css/vendor/font-awesome.min.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions assets/css/vendor/select2.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

98 changes: 98 additions & 0 deletions assets/js/vendor/higooglefonts.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
/*!
* jQuery HiGoogleFonts Library v0.1.0
* http://asadiqbal.com/
*
* Uses select2 jquery library for creating Picker
*
* Copyright Hiwaas and other contributors
* Released under the Apache license 2.0
* https://github.com/saadqbal/HiGoogleFonts/blob/master/LICENSE
*
* Date: 2016-Feb-20
*/


(function ( $ ) {
$.fn.higooglefonts = function(options) {

var settings = $.extend({
placeholder: 'Choose a font family',
theme: 'default',
selectedCallback: function(params) { },
loadedCallback: function(params) { }
}, options );


var data = data || [];

fonts.forEach(function(font,index){

data.push({
id : font,
text : font,
itemId : index
});

});

var y=0;
this.select2({
placeholder: settings.placeholder,
theme: settings.theme,
data: data,
triggerChange: true,
allowClear: true,
templateResult: function (result) {
//var state = $('<div style="background-position:-10px -'+y+'px !important;" class="li_'+result.itemId+'">'+result.text+'</div>');
var item = '<style>@import url("https://fonts.googleapis.com/css?family=' + result.text.replace(" ", "+") + '");</style><div style="font-family:' + result.text + '">'+result.text+'</div>';
var state = $(item);
y +=29;
return state;
}
});

this.on("select2:open", function (e) {
y=0;
});
this.on("select2:close", function (e) {
y=0;
});
this.on("select2:select", function (e) {
var font_family = e.params.data.text;

if (typeof settings.selectedCallback == 'function') { // make sure the callback is a function

settings.selectedCallback.call(this, e.params.data.text); // brings the scope to the callback
}




WebFont.load({
google: {
families: [font_family]
},
fontactive: function(familyName, fvd) {

if (typeof settings.loadedCallback == 'function') { // make sure the callback is a function

settings.loadedCallback.call(this, familyName); // brings the scope to the callback
}


}
});

});

// Set empty initial value
this.val('');
this.trigger('change');

}; /// End of function

var fonts = [
"Abel", "Abril Fatface", "Acme", "Alegreya", "Alex Brush", "Amaranth", "Amatic SC", "Anton", "Arbutus Slab", "Architects Daughter", "Archivo", "Archivo Black", "Arima Madurai", "Asap", "Bad Script", "Baloo Bhaina", "Bangers", "Berkshire Swash", "Bitter", "Boogaloo", "Bree Serif", "Bungee Shade", "Cantata One", "Catamaran", "Caveat", "Caveat Brush", "Ceviche One", "Chewy", "Contrail One", "Crete Round", "Dancing Script", "Exo 2", "Fascinate", "Francois One", "Freckle Face", "Fredoka One", "Gloria Hallelujah", "Gochi Hand", "Great Vibes", "Handlee", "Inconsolata", "Indie Flower", "Kaushan Script", "Lalezar", "Lato", "Libre Baskerville", "Life Savers", "Lobster", "Lora", "Luckiest Guy", "Marcellus SC", "Merriweather", "Merriweather Sans", "Monoton", "Montserrat", "News Cycle", "Nothing You Could Do", "Noto Serif", "Oleo Script Swash Caps", "Open Sans", "Open Sans Condensed", "Oranienbaum", "Oswald", "PT Sans", "PT Sans Narrow", "PT Serif", "Pacifico", "Patrick Hand", "Peralta", "Permanent Marker", "Philosopher", "Play", "Playfair Display", "Playfair Display SC", "Poiret One", "Press Start 2P", "Prosto One", "Quattrocento", "Questrial", "Quicksand", "Raleway", "Rancho", "Righteous", "Roboto", "Roboto Condensed", "Roboto Slab", "Rubik", "Rye", "Satisfy", "Shadows Into Light", "Shojumaru", "Sigmar One", "Skranji", "Slabo 27px", "Special Elite", "Tinos", "Ultra", "UnifrakturMaguntia", "VT323", "Yanone Kaffeesatz"
];

}( jQuery ));
Loading

0 comments on commit 5d5f563

Please sign in to comment.