Skip to content

Instantly share code, notes, and snippets.

@pratham2003
Created January 7, 2015 09:58
Show Gist options
  • Select an option

  • Save pratham2003/d79f1cb53e23d4aba0af to your computer and use it in GitHub Desktop.

Select an option

Save pratham2003/d79f1cb53e23d4aba0af to your computer and use it in GitHub Desktop.

Revisions

  1. pratham2003 revised this gist Jan 7, 2015. 1 changed file with 5 additions and 0 deletions.
    5 changes: 5 additions & 0 deletions sharebar.js
    Original file line number Diff line number Diff line change
    @@ -1,2 +1,7 @@
    var whatsappText = _args['text'].replace(/%25URL%25/,_args['url']).replace(/(%25NL%25)/g,'%0A');
    if(window.navigator.appVersion.match(/Chrome\/(.*?) /)[1]) {
    var chrome_ver = parseInt(window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10);
    if(chrome_ver > 37 && chrome_ver < 40)
    whatsappText = _args['text'].replace(/%25URL%25/,_args['url']).replace(/(%25NL%25)/g,'%20');
    }
    var twitterText = _args['text'].replace(/%25URL%25/,'').replace(/%25NL%25/g,' ');
  2. pratham2003 created this gist Jan 7, 2015.
    2 changes: 2 additions & 0 deletions sharebar.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,2 @@
    var whatsappText = _args['text'].replace(/%25URL%25/,_args['url']).replace(/(%25NL%25)/g,'%0A');
    var twitterText = _args['text'].replace(/%25URL%25/,'').replace(/%25NL%25/g,' ');