require.config({ baseUrl: '/assets/js', paths: { jquery: 'jquery-3.7.1.min', bootstrap: 'bootstrap.min' }, shim: { bootstrap: ['jquery'] }, waitSeconds: 0 }); stogram = function() { var self = this; self.plugins = {}; self.init = function(container) { $('[data-selected]').each(function(idx) { var v = $(this).data('selected'); $('option', this).each(function() { if ($(this).val() == v) { $(this).prop('selected', 1); } }); }); require(['bootstrap'], function() { $('[data-toggle="tooltip"]').tooltip(); $('[data-spy="affix"]').affix(); }); $('a').each(function() { var href = $(this).attr('href'); var url = window.location.pathname; if ($(this).attr('role') != 'nav') { return; } if ( (url == href || (window.location.href.indexOf(window.location.host + href) >= 0 && href != '/' && !$(this).data('exact')) || (href == '/' && url == window.location.origin + '/')) && $(this).attr('role') == 'nav' ) { $(this).addClass('active'); $(this).parent().addClass('active'); } }); $('[data-plugin]', container).each(function(idx) { var plugin = $(this).attr('data-plugin'); var opts = $(this).data(); opts.el = $(this); if (!opts.id) { opts.id = 'st-plugin-' + plugin + '-' + idx; $(this).attr('data-id', opts.id); } self.plugin(plugin, opts); }); }; self.plugin = function(name, opts, callback) { var fa = name.match(/\-(\w)/g); var plugin = {}; if (fa) { for (var x in fa) { func = name.replace(fa[x], fa[x].toUpperCase()).replace('-', ''); } } var func = eval('self.' + func); if (func) { func(el, opts); } else { require(['stogram/plugins/' + name], function(plugin) { plugin = new plugin(opts); if (callback) { callback(plugin); } self.plugins[opts.id] = plugin; }); } }; var num = 0; self.message = function(msg, timeout, type) { num++; var id = 'message-' + num; var className = 'message-' + (type ? type : 'info'); if (!$('.message').length) { $('body').append('
'); } $('.message').append('