WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Could anybody help me solving this problem? (21 posts)

  1. Neo
    Member
    Posted 9 months ago #

    The typed datas should look like this in case of Youtube videos <a href=""http://youtube.com/embed+ after the watch v (given by the user) " class="lightview"> and here comes the name of the video given by the user </a>.
    This link would be in the text area, and when he clicks on "watch in youtube "border"".
    Basic links:
    <a href"http://+ address given by the user"class="lightview">Link given by the user</a>
    If you can't understand my question,please view my picture:
    http://www.kephost.com/view3.php?filename=a1_2013_7_22_mb42nuqo70.png

  2. Ihor Vorotnov
    Member
    Posted 9 months ago #

    NeoCsatornaja, sorry, but your english description is really hard to understand. As I understand you need to get the ID of the video from input field, any other attributes like alt/title and the actual text of link to be displayed from corresponding inputs and depending on what button was pressed (video or link) write correct link code to textarea with id="comment". Please, confirm if I'm right or correct. It can be done with a little custom javascript, I can do it for you when you confirm or correct my guess. Need to clearly understand the task to provide you with right solution.

  3. Neo
    Member
    Posted 9 months ago #

    Almost!
    But thx for trying.
    I just get a video id and link name with class="lightview" and under when click user the buton the html tag is visible the text area.
    The class is necessary for the lightbox.
    And somehow must be add to user link if user want...

  4. Ihor Vorotnov
    Member
    Posted 9 months ago #

    Things aren't getting easier :) Let's try with schematic approach.
    1. You have a form with fields:
    - input text: youtube video id
    - input text: video name (to use it in alt or title attribute?)
    - input text: link name (the actual text of the link to be displayed?)
    2. And buttons, they paste a code to textarea id="comments":
    - button A: pastes a video embed html code into textarea
    - button B: pastes a link to youtube URL into textarea, the link will open in lightbox

    Right?

  5. Neo
    Member
    Posted 9 months ago #

    -Yes.
    -I did not think it to be used as alt tags wedges, I thought that it is possible to print out anything only html form input box.
    -Yes!
    A buton paste the embed video url and link name
    B buton paste the simpel link URL and link name
    But url for the youtube video must be begin:
    http://youtube.com/embed

  6. Ihor Vorotnov
    Member
    Posted 9 months ago #

    Ok, I got it. Basically, you need to trigger js function when clicking your buttons. This function gets the values from inputs, merges with predefined text (like http://youtube.com/embed before text, full A tag code etc) and adds the final result to textarea.

    Check this: http://jsfiddle.net/grRPw/
    Now it'll be easier to understand what you need.

  7. Neo
    Member
    Posted 9 months ago #

    Okey this very good just i how to add the class="lightview" atribut?
    Otherwisw thx for the working!

  8. Neo
    Member
    Posted 9 months ago #

    And the firs inputy type look out as the second only in the field as a simple link to pay it.
    example:
    <a href="http://+user typed" class="lightview">User typed</a>
    Sorry for my english I'KNOW VERY hard understand me.
    But this ques. not easier even my language:D

  9. Andrew Nevins
    Barrel Rider, Spam Zapper & Volunteer Moderator
    Posted 9 months ago #

    Can you link the webpage you're trying to modify?

  10. Neo
    Member
    Posted 9 months ago #

    Yeah,sure!
    http://szantai.mblx.hu/wp/ide-irhattok-hozzaszolasokatlekereseket/#comments
    If you clik the link you see some buttons in comment form.
    If you click the "linkek megnyitása keretben" the script paste this:
    <a href="ide addmeg az url-t//give me url"class="lightview">Ide ad meg a link nevét //give me a name!</a>
    But this so complicated for the simple user.
    However, what has been written Ihor Vorotnov go very close to what I want, specifically, the second field has been created I need.

  11. Neo
    Member
    Posted 9 months ago #

    So i'd like to embed all links my lightbox.
    But lightbox need class="lightview" in <a> becouse only it just works.
    But youtube link differend url,becouse block the iframe content,exception youtube.com/embed/(watch v under id).
    I try to be there for visitors this step of having to go to another page to see a link.

  12. Ihor Vorotnov
    Member
    Posted 9 months ago #

    Added 'lightbox' class:
    http://jsfiddle.net/grRPw/4/

    Didn't understand you second comment about the first input, sorry :)
    Try to write it in your language and translate via Google Translate, then paste the translation here. Maybe this way it will work better.

  13. Neo
    Member
    Posted 9 months ago #

    okey i drop my text google translate,let's try:
    The ligthbox plugin iframe embed the links to see if the correct syntax.
    Proper syntax for an average link
    <a href="http://enetred by user in input field,example dot.tk"class="lightview"> Link name </ a>
    But the link with youtube is blocked in the iframe embedding should be used in the following address:
    http://youtube.com/embed/and the youtube video ID
    So you've got Various ways to enroll the youtube link so you can look like this:

    <a href="http://youtube.com/emberd/entered by the user video ID"> what the user Entered
    </ a>
  14. Ihor Vorotnov
    Member
    Posted 9 months ago #

    Okay, this text sounds like a YouTube manual.
    Check this: http://jsfiddle.net/grRPw/5/

  15. Neo
    Member
    Posted 9 months ago #

    Okey almost!
    But the second link a user to enter the field, so a simple web address, do not have the youtube link.example:http://facebook.com And when click the second button, and then enter.

  16. Neo
    Member
    Posted 9 months ago #

    If you are done i put your name my website(if you want) like special thanks for Ihor Vorotnov :))

  17. Neo
    Member
    Posted 9 months ago #

    I create html form for your code :D
    http://jsfiddle.net/NeoCsatornaja/Bdy9n/3/

  18. Ihor Vorotnov
    Member
    Posted 9 months ago #

  19. Neo
    Member
    Posted 9 months ago #

    I found the solution and i like to show!
    Html:

    <p>
    	<label for="ytlink">Youtube.com/watch?v=</label>
    	<input type="text" id="yt_link" name="ytlink" />
    	<label for="ytlinkname">Video name:</label>
    	<input type="text" id="yt_link_name" name="ytlinkname" />
    	<input type="button" id="btn1" value="Video Paste" onclick="yt_link_transfer();" />
    </p>
    <p>
    	<label for="link">http://</label>
    	<input type="text" id="link" name="link" />
    	<label for="linkname">Link name:</label>
            <input type="text" id="link_name" name="linkname"/>
            <input type="button" id="btn2" value="Link Paste" onclick="link_transfer();" />
    </p>
    <input type="textarea" id="comment">

    Head with jqvery:

    function yt_link_transfer(){document.getElementById("comment").value += '<a href="http://www.youtube.com/embed/';document.getElementById("comment").value += document.getElementById("yt_link").value;document.getElementById("comment").value += '?autoplay=1';document.getElementById("comment").value += '" class="lightview">';document.getElementById("comment").value += document.getElementById("yt_link_name").value;document.getElementById("comment").value += '</a> ';}function link_transfer(){document.getElementById("comment").value += '<a href="http://';document.getElementById("comment").value += document.getElementById("link").value;document.getElementById("comment").value += '" class="lightview">';document.getElementById("comment").value += document.getElementById("link_name").value;document.getElementById("comment").value += '</a> ';}

    Thx for the support and work everyone,special thanks for:
    Ihor Vorotnov, you're best!

  20. Ihor Vorotnov
    Member
    Posted 9 months ago #

    The script does basically the same but with pure javascript (my version was for jQuery). And separating YouTube and Link inputs is logical. Glad you managed to make it work! Good luck! :)

  21. Neo
    Member
    Posted 9 months ago #

    thx for the support.
    Can you share this the popular site?
    Sure many people will be looking for.
    Otherwise, jquery 2.0 works alone, so be sure to add: D
    if you think create the plugin this and lightview:D

Reply

You must log in to post.

About this Topic