Home / Forums / DynamiX Support / PrettyPhoto Function getHashtag, setHashtag and clearHashtag

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts

  • Mosaica
    Participant

    Please, how to remove hashtag from URL when using prettyPhoto.  > /#!prettyPhoto[gallery]/1/

    function code found in dymamix.js.

    Nothing in jquery.prettyPhoto.js

    no-margin-for-errors.com site is only for jquery.prettyPhoto.js file.

     

    Now I've done this:

     

    getHashtag function () {

    location.href = url;

    hashtag = (url.indexOf ('#')! == -1)? decodeURI (url.substring (url.indexOf ('#') +2, url.length)): false;

    return hashtags;

    };

     

    setHashtag function () {

    if (typeof theRel == 'undefined') return; / / Setting On theRel is normal calls, it's impossible to deeplinks using the API

    location.hash theRel + = '/' + rel_index + '/';

     

    };

     

    clearHashtag function () if (location.href.indexOf ('# prettyPhoto')! == -1) = location.hash "prettyPhoto";

    };

     

    But do not do what I want.

    My client does not want this, what should I do?

     

    thank you very much

    Andy
    Andy
    Keymaster

    Hi,

    This is a prettyPhoto function – there is nothing in DynamiX which controls this, I'd try the prettyPhoto forums instead. 


    Flickapix Dezign
    Participant

    your answer is the prettyphoto js file in theme your answer is here:

     

    http://forums.no-margin-for-errors.com/discussion/1644/how-to-remove-annoying-prettyphoto0-string-from-url/p1

     

    it worked for me many times over in various themes


    Mosaica
    Participant
    Andy,

    thanks for the help but the code above is copied from there into DynamiX.js.

    then that path: lib / adm / help / js / jquery.prettyPhoto.js functions: getHashtag, andsetHashtag clearHashtag not exist.

     

    FLiCKaPiX Photography, how do you explain please?.

     

    Sorry to disturb you and my poor English

    the site, with Dynamix, it is very nice.

     

    thanks
    Andy
    Andy
    Keymaster

    Hi,

    This is the snippet you need (thanks Dan). 

    Replace –> clearHashtag(){url=location.href;hashtag=(url.indexOf('#!prettyPhoto'))?true:false;if(hashtag)location.hash="!prettyPhoto";}

    by –> clearHashtag(){url=location.href;hashtag=(url.indexOf('#!prettyPhoto')>0)?true:false;if(hashtag)location.hash="!prettyPhoto";}

    The problem is though the javascript is minified so you won't be able to find this code in the core javascript file – DynamiX/js/dynamix.min.js

    You'll need to edit DynamiX/js/dynamix.js and find and edit the code there then re minify the code and place in to DynamiX/js/dynamix.min.js. 

    If you have problems contact me and I'll do this as a small customisation. 


    Mosaica
    Participant

    Hello Andy,

    I did as you said in dynamix.js then I found this websitehttp://www.minifyjs.com/javascript-compressor/

    I copied and pasted the dynamix.js code in minified compressor.

    Now I do not know if it works because it disables the lightbox.

    This is my dinamix.js code: Clic


    Flickapix Dezign
    Participant

    this is the code that needs to be replaced, its line 899

    replace;

     

    function clearHashtag(){

    // Clear the hashtag only if it was set by prettyPhoto

    url = location.href;

    hashtag = (url.indexOf('#!prettyPhoto')) ? true : false;

    if(hashtag) location.hash = "!prettyPhoto";

    };

    with;

    function clearHashtag(){

    // Clear the hashtag only if it was set by prettyPhoto

    url = location.href;

    hashtag = (url.indexOf('#!prettyPhoto')>0) ? true : false;

    if(hashtag) location.hash = "!prettyPhoto";

    };

    dont use find and replace for this one, 

    it appears the script has been encoded using the dean edwards packer, so minify your new dynamix.js file then visit here to package it

    http://dean.edwards.name/packer/

    make sure to check the boxes for shrink variables and base62 encode.

    and then rename the file to dynamix.min.js, backup your origionals first,

    see if that works


    Mosaica
    Participant

    FLICK, I'm sorry but it does not work.

    It seems always this: #! PrettyPhoto [gallery] / 1 /

    I do not know what to do : (


    Flickapix Dezign
    Participant

    cleared browser cache and any cache plugins?

    is it just its appearance that bothers the client? couldnt you just do a url rewrite in .htaccess if thats the case?


    Mosaica
    Participant

    We are the winner's!

    This is a process:

    1) dynamix.js

    function getHashtag(){

    url = location.href;

    hashtag = (url.indexOf('') != 0) ? decodeURI(url.substring(url.indexOf('#!')+2,url.length)) : false;

    return hashtag;

    };

     

    function setHashtag(){

    //if(typeof theRel == 'undefined') return; // theRel is set on normal calls, it's impossible to deeplink using the API

    //location.hash = '!' + theRel + '/'+rel_index+'/';

     

    //showing query string in url stoped by ashiq

    };

     

    function clearHashtag(){

    // Clear the hashtag only if it was set by prettyPhoto

    url = location.href;

    hashtag = (url.indexOf('')>0) ? true : false;

    if(hashtag) location.hash = "";

    };

    2) Encodeding dynamix.js using the dean edwards packer

    Thank you

    Andy
    Andy
    Keymaster

    Glad you guys got this working, thanks for the help (so good to have people lending a hand..)  

Viewing 11 posts - 1 through 11 (of 11 total)

You must be logged in to reply to this topic.