1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Not Planned build "Bookmarklet" into Editor for full Drag & Drop capability

Discussion in 'Closed Suggestions' started by erich37, Jun 18, 2013.

  1. erich37

    erich37 Well-Known Member

    Suggestion:

    build a "Bookmarklet" directly into the Editor for full "Drag & Drop" capability of images and associated image-URLs.

    Bookmarklets are very well known to be used in your Browser-Bar.
    But what about adding this "functionality" directly into the Editor ?


    So it would not be a "Browser Bookmarklet", but an "Editor Bookmarklet".


    Would it work technically ?
     
  2. Jeremy

    Jeremy XenForo Moderator Staff Member

    What exactly would this bookmarklet do?
     
  3. erich37

    erich37 Well-Known Member

    it would do exactly the same as commonly known "Browser Bookmarklets".

    But you would not drag the "Bookmarklet" into your Browser-Bar.


    This "Bookmarklet" would be built into the Redactor-Editor directly and would work Browser-independent.


    I have not come across anything like that yet, but I think it would give Forums a groundbreaking leap forward.....


    :)
     
    Last edited: Jun 18, 2013
  4. Jeremy

    Jeremy XenForo Moderator Staff Member

    What do you define as a 'bookmarklet'? The definition of a bookmarklet is:
    Not discrediting the suggestion, I'm just failing to see what it's suggesting.
     
  5. erich37

    erich37 Well-Known Member




    The question is:
    - Would it work from a logical and also from a technological perspective ?


    The idea is that you actually do not have that JS-Snippet in your Browser-Bar, but you have this capability (and this JS-Snippet code) directly within the Redactor-Editor.



    Some Links:
    http://coding.smashingmagazine.com/2010/05/23/make-your-own-bookmarklets-with-jquery/

    http://stackoverflow.com/questions/...like-pinterest-snatchly-that-can-scrap-images

    http://thecodepost.in/internet/get-the-official-twitter-share-bookmarklet

    https://dev.twitter.com/docs/share-bookmarklet

    :coffee:
     
  6. Jeremy

    Jeremy XenForo Moderator Staff Member

    I don't think it would work from any stand point. Here's the bookmarklet I have in my browser bar right now:
    Code:
    javascript:(function()%7Bph='[redacted]';s0=document.createElement('SCRIPT');s0.type='text/javascript';s0.src='http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js';s=document.createElement('SCRIPT');s.type='text/javascript';s.src='http://private';document.getElementsByTagName('head')%5B0%5D.appendChild(s0);document.getElementsByTagName('head')%5B0%5D.appendChild(s);%7D)();
    This takes the current page and texts it to my phone. The tweet button takes the current page URL and tweets it. I'm not exactly sure what the Pin It bookmarklet does, since I don't use Pinterest. However, bookmarklet is a broad term and can be for any functionality as defined. I have yet to see you actually answer the question of what you want this bookmarklet to do, before a 'can it work' is even determined.

    However, I don't think it will work because it'll only have access to your current page, not a different one, so it will be rather limited it functionality.
     
  7. erich37

    erich37 Well-Known Member

    Example:

    let's say you have 2 Browser-windows open and shown on your computer:

    - 1 Browser-window shows http://xenforo.com/community/forums/general-xenforo-discussion-and-feedback.45/create-thread
    - 1 Browser-window shows some other page, e.g.: http://www.shashca.com/2013/05/sooraj-aj-218p-m-pe-hoga-khana-kaaba-k-oper/


    Process:
    1)
    You are at the xenforo-website and click onto the "Bookmarklet Button" in the XenForo-Editor.

    2)
    the Bookmarklet automatically detects the images at the other Browser-window, e.g.: this one http://www.shashca.com/2013/05/sooraj-aj-218p-m-pe-hoga-khana-kaaba-k-oper/

    3)
    The Bookmarklet automatically pulls the images of that other browser-window into the XenForo-Editor.

    4)
    Now you select which images from that second website you want to display in the Editor.

    5)
    You click "Post Reply" at the XenForo-Editor and the selected image gets posted at the XenForo-website.


    :coffee:
     
  8. Jeremy

    Jeremy XenForo Moderator Staff Member

    Now that we have a valid suggestion in here (on the functionality), I can say that it won't be technically possible. Unless there's some fancy JavaScript hack that I am not aware, JavaScript has access to the 'window' (the current page) and nothing else. Browsers have started segregating different pages into different processes which would make the situation even more complicated on the code end.

    It gets even muddier when you have more than one window open. I currently have 6 tabs open, which one does the images get pulled in from? Feasibly, this can't be implemented.
     
  9. erich37

    erich37 Well-Known Member


    come on KK...... everything is technically possible nowadays.


    If you are a good with computer, you can even put MP3 into a watch :p;)






    Anyway, not sure if the process I described above makes any sense at all or if it should be totally different.
    But I guess you get the basic idea..... :cautious:

    Brainstorming for innovation.....
     
  10. Jeremy

    Jeremy XenForo Moderator Staff Member

    It makes sense (once you defined what functionality you were actually suggesting). In the manner you are suggesting, it's fairly impossible. Your current window only has access to itself, any JavaScript has access to the HTML of the current page.

    And it becomes even more difficult once browsers start segregating processes + more tabs. Ripe for an add-on to take a URL, fetch any images and display them. Not something I'd like to see in the core tho.
     
  11. erich37

    erich37 Well-Known Member

    well, I guess there is a "reason" all the other guys are making "Browser Bookmarklets" which you drag into your Browser-Bar ?

    Anyway, it is just an idea which came to my mind..... not to facilitate the "Browser Bar", but to build it right into the Editor.


    Maybe it would work without even having a Button in the Editor ? Just having the capability build into the Editor, so that the Editor pulls the image via "Drag & Drop" and displays the image and the image-URL.
    And getting rid of the long image-code (I guess this is called "URI-code") ?

    :coffee:
     
  12. Jeremy

    Jeremy XenForo Moderator Staff Member

    The bookmarklets you speak of are built outside of a page realm and the browser executes them using the current tab.

    The current drag and drop implementation does attempt to pull in the URLs for images.
     
  13. erich37

    erich37 Well-Known Member


    yeah.....

    if you find a solution to "combine" those 2 features into 1 feature...... then I will call you "King" until the end of my lifetime.

    ;)
     
  14. Jeremy

    Jeremy XenForo Moderator Staff Member

    I personally don't think the current implementation is incomplete or that a bookmarklet type button would be worth the hassle knowing all the barriers. And you can call me Jeremy, King isn't necessary. lol
     
    erich37 and Brogan like this.
  15. erich37

    erich37 Well-Known Member

    a question for experts, please:

    are "Browser Bookmarklets" also using "URI" ?

    :coffee:
     
  16. Brogan

    Brogan XenForo Moderator Staff Member

  17. erich37

    erich37 Well-Known Member

  18. Jeremy

    Jeremy XenForo Moderator Staff Member

    No, bookmarklets are mini-JavaScript applications stored within your browser's bar.
     

Share This Page