littleneila

N Google Calendar JS

Jul 28th, 2016
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (function() {
  2.  
  3.     var script = document.createElement("script");
  4.     script.src = 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js';
  5.     script.type = 'text/javascript';
  6.     document.getElementsByTagName("head")[0].appendChild(script);
  7.  
  8.     // Poll for jQuery to come into existance
  9.     var checkReady = function(callback) {
  10.         if (window.jQuery) {
  11.             callback(jQuery);
  12.         }
  13.         else {
  14.             window.setTimeout(function() { checkReady(callback); }, 100);
  15.         }
  16.     };
  17.  
  18.     // Start polling...
  19.     checkReady(function($) {
  20.  
  21.         addGoogleFont("Montserrat");
  22.  
  23.         //addCss("//pastebin.com/raw/ta0JSDbM");
  24.  
  25.         setTimeout(function() {
  26.             resizeDivs();
  27.         }, 500);
  28.  
  29.         $("body").click(function() {resizeDivs()});
  30.     });
  31.  
  32.  
  33.  
  34. })();
  35.  
  36. window.onresize = function(event) {
  37.     resizeDivs();
  38. }
  39.  
  40.  
  41. function resizeDivs() {
  42.     $(".chip").width($(".tg-col-eventwrapper").width()+3);
  43. }
  44.  
  45. function addGoogleFont(fontName) {
  46.     $("head").append("<link href='//fonts.googleapis.com/css?family=" + fontName + "' rel='stylesheet' type='text/css'>");
  47. }
  48.  
  49. /*
  50. function addCss(cssFile) {
  51.     $('head').append("<link rel='stylesheet' href='" + cssFile + "' type='text/css' />");
  52. }
  53. */
Add Comment
Please, Sign In to add comment