asee

Upload: buggie

Post on 09-Mar-2016

217 views

Category:

Documents


0 download

DESCRIPTION

once upon a time, there was a pdf...

TRANSCRIPT

  • _sf = {

    lang: 'en',

    cookieDomain: '.savefrom.net'

    };

    (function(){

    var uaParser = new UAParser();

    _sf.browser = uaParser.getBrowser() || {};

    _sf.device = uaParser.getDevice() || {};

    _sf.os = uaParser.getOS() || {};

    if(!_sf.device.type && _sf.os.name)

  • {

    if(['Android', 'Bada', 'BlackBerry', 'Firefox OS', 'iOS', 'MeeGo', 'Sailfish', 'Series40',

    'Symbian', 'Tizen', 'WebOS', 'Windows Phone'].indexOf(_sf.os.name) > -1)

    {

    _sf.device.type = 'mobile';

    }

    }

    if(_sf.device.type)

    {

    if(_sf.device.type == 'tablet')

    {

    _sf.mobile = true;

    $('html').addClass('tablet');

    }

    else if(_sf.device.type == 'mobile' || _sf.device.type == 'wearable')

    {

    _sf.mobile = true;

    $('html').addClass('mobile');

    }

    }

    })();

    $(function(){

    $('input[placeholder], textarea[placeholder]').placeholder();

    setTooltipHandler('.tooltip[title]');

    setTooltipHandler('.tooltip-err[title]', {className: 'err'});

    // menu

    $('nav li').on('mouseenter', function(){

    if($(this).children('ul').is('ul'))

    {

  • $(this).addClass('hover').on('mouseleave', function(){

    $(this).removeClass('hover');

    });

    }

    });

    $('body').on('click', 'header .menu-btn', function(){

    $('#nav_top').toggleClass('active');

    });

    $('body').on('click', '.spoiler-title', function(){

    var $this = $(this).toggleClass('open');

    var $box = $this.parent().children('.spoiler-box');

    if($this.hasClass('open'))

    $box.slideDown();

    else

    $box.slideUp();

    return false;

    });

    var thumbnail_rel = [];

    $('a.thumbnail').each(function(){

    var rel = $(this).attr('rel');

    if(rel && !thumbnail_rel[rel])

    {

    thumbnail_rel[rel] = 1;

    $("a[rel='" + rel + "']").fancybox();

    }

    });

    $('body').on('click', 'img.thumbnail', function(){

  • this.src = this.src.replace(/(\w\w)\.([a-z]{3,4})(?:\?|$)/i, function(s, p1, p2){

    if(p1 == '_t')

    return '.' + p2;

    return p1 + '_t.' + p2;

    });

    });

    });

    function setTooltipHandler(selector, options)

    {

    var opts = {

    fade: true,

    opacity: 1,

    delayIn: 300,

    delayOut: 500,

    hoverHold: true,

    html: true,

    gravity: 's',

    offset: 5,

    live: true,

    title: function(){

    if (window.ga && $(this).hasClass('ga_track_events')) {

    var data = $(this).data('tooltip-ga-event');

    if (data) {

    data = data.replace(/;+$/, '');

    data = data.split(';');

    if(data.length < 2)

    return;

    data.unshift('send', 'event');

    ga.apply(null, data);

  • }

    }

    return $(this).attr('original-title');

    }

    };

    if(options)

    opts = $.extend({}, opts, options);

    $(selector).tipsy(opts);

    }

    function jAlert(message, sticky, theme, position)

    {

    $.jGrowl.defaults.closer = false;

    $.jGrowl.defaults.closeTemplate = '';

    var options = {

    sticky: sticky ? true : false,

    life: 5000

    };

    if(theme)

    options['theme'] = theme;

    if(position)

    options.position = position;

    $.jGrowl(message, options);

    }

    function jAlertErr(message, sticky, position)

  • {

    if(sticky === undefined)

    sticky = true;

    jAlert(message, sticky, 'err', position);

    }

    function showMessage(message, onCloseClick, onBtnClick)

    {

    if(!message)

    return;

    $('.top-message-bar').remove();

    var $panel = $('').hide();

    $panel.append('' +

    '' + message + '' +

    '' +

    ''

    );

    $panel.prependTo('body').slideDown();

    $panel.on('click', '.close-btn', function(){

    if(onCloseClick) {

    onCloseClick();

    }

    $panel.fadeOut(function(){

    $panel.remove();

    });

    });

    if(onBtnClick) {

  • $panel.on('click', '.button', onBtnClick);

    }

    }

    (function() {

    var sf = window._sf;

    if (sf && sf.os && sf.os.name === 'Mac OS') {

    !function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?

    n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;

    n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;

    t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,

    document,'script','//connect.facebook.net/en_US/fbevents.js');

    fbq('init', '978059908934144');

    fbq('track', "PageView");

    }

    })();

    if (_sf.os.name == 'Windows' && _sf.browser.name == 'IE')

    location.href = location.href.replace(/\/1-/, '/102-');

  • if(top!=self && (!document.referrer ||

    document.referrer.search(/^(https:\/\/www\.google\.com\/analytics\/web\/|https?:\/\/metri

    ka.yandex.ru\/)/i) !== 0))

    top.location=location;

    sf.setLanguage({"lang":"en","wait":"Please

    wait","result":"Result","download":"Download","startDownload":"Start

    download","copy":"Copy","playerPlay":"Play","playerStop":"Stop","link":"Link","title":

    "Title","file":"File","size":"Size","hosting":"Hosting","information":"Information","sour

    ce":"Source","duration":"Duration","more":"More","multiMore":"Find more

    links","linkNotFound":"The download link not

    found.","pluralSeconds":["second","seconds"],"pluralParts":["part","parts"],"findMediaL

    inks":"Find links to media files","fileInfoTitle":"Display file

    information","copyLinkSuccess":"The download link is copied to the

    clipboard.","copyLinkFail":"Unable to copy the link to the

    clipboard.","copyLinksSuccess":"The download links are copied to the

    clipboard.","copyLinksFail":"Unable to copy the links to the

    clipboard.","flashPlayerRequired":"Perhaps you do not have Adobe Flash

    Player installed.","dQueueError":"Unable to start downloading the

    file","dQueueContinue":"Continue downloading the remaining

    files?","dQueueYes":"Continue","dQueueNo":"Stop","tblHdrDownload":"Download

    links","tblHdrInformation":"Information","tblHdrFile":"File","tblHdrSize":"Size","error

    1":"Error: URL not specified.","error2":"Error: invalid URL specified.","error3":"Error:

    code not specified.","error4":"Please specify what to search.","error5":"Please specify

    where to search.","error20":"Error: %s element not found.","player_err1":"To view this

    video, you need to get the download links.","request_err1":"Failed to make the request.

    Please try again.","request_err2":"Failed to make the

    request.","notEnoughPoints1":"Not enough points to download this

    file","notEnoughPoints2":"You do not have enough points to download selected

    files","allSites":"all popular websites","helper_lite":"Helper","installHelper":"Install

    SaveFrom.net helper","helperFull":"SaveFrom.net helper","installUvd":"Install Ummy

    Video Downloader","recommendProduct":{"helper":"We recommend you to install SaveFrom.net helper extension to download from

    {service} in 1 click.","uvd":"We recommend you to install Ummy Video Downloader to download from {service}

    in 1 click."}});

  • sf.linksListToken = "#__savefrom.net_links__";

    sf.jsonToken = "#json#";

    _sf.query = sf.parseQuery() || {};

    _sf.hash = sf.parseQuery(location.hash) || {};

    _sf.app = _sf.query.app || _sf.hash.app || '';

    if (_sf.app != 'sf-android') {

    _sf.app = '';

    }