Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    Sencha User
    Join Date
    Aug 2011
    Posts
    206
    Vote Rating
    8
    allisterf is on a distinguished road

      0  

    Default Applying a convert function

    Applying a convert function


    Hope someone can help me on this one. I need to take content that comes in to a store on a json feed, which has <a href> links in it, and append to each each link the _blank target attribute.


    It's a bit unclear to me where to try to put that, but I assumed the right place is to add a convert function into the model for that feed, set onto the correct field. However, I can't seem to get anything to work. the convert code I using is:


    Code:
    var links = document.getElementsByTagName('a');
    var len = links.length;
    
    
    for(var i=0; i<len; i++)
    {
       links[i].target = "_blank";
    }
    Not sure if the issue is with the code or with the way I'm trying to implement it into SA.


    Thanks for your help.
    Allister

  2. #2
    Sencha User
    Join Date
    May 2010
    Location
    Sapiranga, Rio Grande do Sul, Brazil
    Posts
    77
    Vote Rating
    1
    sergiomichels is on a distinguished road

      0  

    Default


    In the model you have just the String. I think you need to do that in the controller, after your html is attached to the page.

    So if you have one javascript to attach your html into a container, after that you can change your links.

  3. #3
    Sencha User
    Join Date
    Aug 2011
    Posts
    206
    Vote Rating
    8
    allisterf is on a distinguished road

      0  

    Default


    Hi there. it certainly helped to put the link coding into the controller function for the list, and did it's job in adding the target _blank.


    Unfortunately, it didn't solve my problem.


    The issue is the new InAppBrowser that's now been incorporated into PhoneGap/Cordova, with the old Childbrowser plugin being phased out. I'd like to use IAB if I can, but to open any link within the app (rather than bounce out to safari), it needs to open a url with
    Code:
    window.open('myurl.com', '_blank', 'location=yes');
    So, I need to capture a url string somehow and then have - I assume - some kind of global or controller function (or convert function on the json feed model?) that opens all http links with the function
    window.open('myurl.com', '_blank', 'location=yes');


    It's probably a simple thing, but could do with a little help if you can.


    Thanks
    Allister

  4. #4
    Sencha User
    Join Date
    May 2010
    Location
    Sapiranga, Rio Grande do Sul, Brazil
    Posts
    77
    Vote Rating
    1
    sergiomichels is on a distinguished road

      0  

    Default


    Looking at the docs it seems that what you want is Ext.query(). I never use it, but it I think you can use it to get the reference for all links and handle them to open as a new popup.

  5. #5
    Sencha User
    Join Date
    Aug 2011
    Posts
    206
    Vote Rating
    8
    allisterf is on a distinguished road

      0  

    Default


    Just to update and close this. I found the following worked to do what I wanted.

    Code:
    var links = document.getElementsByTagName('a');
    var len = links.length;
    
    
    for(var i=0; i<len; i++)
    {
        links[i].addEventListener('click', function(e){
            window.open(this.href, '_blank', 'location=yes');
            e.preventDefault();
        });
    }
    Allister

Thread Participants: 1

Tags for this Thread