Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(Meteor.isClient){
- toastr.options = {
- "closeButton": false,
- "debug": false,
- "newestOnTop": false,
- "progressBar": false,
- "positionClass": "toast-top-center",
- "preventDuplicates": false,
- "onclick": null,
- "showDuration": "300",
- "hideDuration": "1000",
- "timeOut": "5000",
- "extendedTimeOut": "1000",
- "showEasing": "swing",
- "hideEasing": "linear",
- "showMethod": "fadeIn",
- "hideMethod": "fadeOut"
- }
- Tracker.autorun(function(){
- Meteor.subscribe("roles");
- Meteor.subscribe("UrlQuality");
- Meteor.subscribe("DigitalMarketingStandards")
- });
- Tracker.autorun(function(){
- if(Meteor.user()){
- Meteor.subscribe("Company",Meteor.userId());
- if(Meteor.user().profile.role == "admin"){
- Meteor.subscribe("images",Meteor.userId());
- }else{
- Meteor.subscribe("images",Meteor.user().profile.company_id);
- }
- Meteor.subscribe("CompanyImages",Meteor.userId());
- company_id = Meteor.user().profile.company_id;
- // Meteor.subscribe("digital_assessment_for_company",company_id)
- if(!Iron.Location.get().path.includes("timeline")){
- if(Meteor.user().profile.role == "Admin"){
- company = Company.findOne({base_company:true})
- }else{
- company_id = Meteor.user().profile.company_id;
- company = Company.findOne({_id:company_id})
- }
- if(company){
- Meteor.subscribe("digital_assessment_for_company",company._id)
- }
- }
- }else{
- var website_name = Cookie.get('digi_page_url') == undefined ? "" : Cookie.get('digi_page_url');
- Meteor.subscribe("digital_assessment_for_domain",website_name)
- }
- });
- $.fn.extend({
- animateCss: function (animationName) {
- var animationEnd = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend';
- this.addClass('animated ' + animationName).one(animationEnd, function() {
- $(this).removeClass('animated ' + animationName);
- });
- }
- });
- }
- url_validate = function(url){
- var url_regx = new RegExp(/(http(s)?:\\)?([\w-]+\.)+[\w-]+[.com|.in|.org]+(\[\?%&=]*)?/);
- if(url_regx.test(url)){
- if(url.includes("http://") || url.includes("https://")){
- return url;
- }else{
- return "http://"+url
- }
- }else{
- return false;
- }
- }
- delay = function (fn, t)
- {
- // private instance variables
- var queue = [], self, timer;
- function schedule(fn, t) {
- timer = setTimeout(function() {
- timer = null;
- fn();
- if (queue.length) {
- var item = queue.shift();
- schedule(item.fn, item.t);
- }
- }, t);
- }
- self = {
- delay: function(fn, t) {
- // if already queuing things or running a timer,
- // then just add to the queue
- if (queue.length || timer) {
- queue.push({fn: fn, t: t});
- } else {
- // no queue or timer yet, so schedule the timer
- schedule(fn, t);
- }
- return self;
- },
- cancel: function() {
- clearTimeout(timer);
- queue = [];
- }
- };
- return self.delay(fn, t);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement