The forum of the forums

Would you like to react to this message? Create an account in a few clicks or log in to continue.
The forum of the forums
5 posters

    help me with this java scripte

    alla13
    alla13
    Forumember


    Posts : 91
    Reputation : 6
    Language : Arab5/5 Eng3/5 Fr2/5

    Solved help me with this java scripte

    Post by alla13 November 15th 2015, 12:16 pm

    Technical Details

    Forum version : #phpBB2
    Position : Founder
    Concerned browser(s) : Mozilla Firefox, Google Chrome, Internet Explorer, Opera, Safari, Other
    Screenshot of problem : https://2img.net/h/oi63.tinypic.com/e5mlna.png
    Who the problem concerns : All members
    Forum link : http://alla-omar.mo-rpg.com

    Description of problem

    Code:
    $(document).ready(function () {
    $('div.postbody div').each(function () {
     Â       if ($(this).text().indexOf('[TBL]') != -1) $(this).html($(this).html().replace(/\[TBL\](.+?)\[\/TBL\]/gi, '<div style="width: 1000px; position: relative;left: 54px;height: 317px;background-image: url(alla13);"></div>
    <br>
    <div style="width: 1000px; position: relative;bottom: 18px;left: 54px;background-image: url(alla13);"><br><br><div align="center">$1</div></div>
    '));      
     Â     });
    });
    $(function(){
     Â $(function(){
     Â   $('<a class="sceditor-button sceditor-button-TBL" unselectable="on"><div unselectable="on" style="background-image:url(http://i21.servimg.com/u/f21/19/09/73/59/back10.png)">TBL</div></a>').insertBefore('.sceditor-button-size').click(function(){
     Â           $('#text_editor_textarea').sceditor("instance").insertText("[TBL]","[/TBL]");
     Â   });
     Â     });
     Â     });

    in the place of alla13 هin the code i wante the url img that i did put between [TBL][/TBL] became Automatically there
    the code is for making background for the topic
    this gif explaine how the code Must work
    https://i.imgur.com/OP24iy0.gif
    vid
    https://www.youtube.com/watch?v=o9uBMbwBeZY&feature=youtu.be
     @angetuteur please help me


    Last edited by alla13 on December 9th 2015, 5:34 pm; edited 4 times in total
    alla13
    alla13
    Forumember


    Posts : 91
    Reputation : 6
    Language : Arab5/5 Eng3/5 Fr2/5

    Solved Re: help me with this java scripte

    Post by alla13 November 16th 2015, 12:30 pm

    bumps
    alla13
    alla13
    Forumember


    Posts : 91
    Reputation : 6
    Language : Arab5/5 Eng3/5 Fr2/5

    Solved Re: help me with this java scripte

    Post by alla13 November 17th 2015, 12:35 pm

    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    Solved Re: help me with this java scripte

    Post by Ange Tuteur November 17th 2015, 1:52 pm

    Hi,

    Forumotion does not support the
    Code:
    [TBL]
    bbcode, so it will not be parsed server-side. I think what you're looking for may be similar to this tutorial, though :
    • Button to choose the message background
    alla13
    alla13
    Forumember


    Posts : 91
    Reputation : 6
    Language : Arab5/5 Eng3/5 Fr2/5

    Solved Re: help me with this java scripte

    Post by alla13 November 17th 2015, 2:10 pm

    what i am looking for is not the code tbl 
    any code do the trick by making backgrounde to the topic
    just by puting img link by the choise of  members
    sorry my english is bad
    alla13
    alla13
    Forumember


    Posts : 91
    Reputation : 6
    Language : Arab5/5 Eng3/5 Fr2/5

    Solved Re: help me with this java scripte

    Post by alla13 November 18th 2015, 3:04 pm

    Bump
    alla13
    alla13
    Forumember


    Posts : 91
    Reputation : 6
    Language : Arab5/5 Eng3/5 Fr2/5

    Solved Re: help me with this java scripte

    Post by alla13 November 19th 2015, 7:42 pm

    Bumps
    Michael_vx
    Michael_vx
    Forumember


    Male Posts : 659
    Reputation : 29
    Language : Arabic and some English
    Location : Egypt

    Solved Re: help me with this java scripte

    Post by Michael_vx November 20th 2015, 12:49 am

    just do then this
    Button to choose the message background
    after that you should be able to use
    Code:
    [postbg=رابط الصورة]
    also your forum is Arabic you should check for help at
    help me with this java scripte Flag_a10 Arabic help me with this java scripte Ar10 Ahlamontada
    i cannot use Arabic language here this is English support forum you should understand that
    alla13
    alla13
    Forumember


    Posts : 91
    Reputation : 6
    Language : Arab5/5 Eng3/5 Fr2/5

    Solved Re: help me with this java scripte

    Post by alla13 November 20th 2015, 10:56 am

    first of all
    thanks
    -the code break when i chose background url of my own 
    -if is possible i would like if you can edit on the scripte up there

    and the arabic support  They said this is impossible to do
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    Solved Re: help me with this java scripte

    Post by Ange Tuteur November 20th 2015, 1:00 pm

    alla13 wrote:
    and the arabic support  They said this is impossible to do
    Impossible ..? Sounds like whoever said that never tried to achieve the "impossible.." bwi

    Firstly, lets try to start fresh with a new button. Add the following script to your JavaScripts.
    Modules > JS codes management > New

    Placement : In all the pages
    Code:
    $(function() {
      if ($.sceditor) {
        $.sceditor.command.set('tbl', {

          exec : function() {
            this.insert('[tbl=',']');
          },

          txtExec : function() {
            this.insert('[tbl=',']');
          },

          tooltip : 'Button title'

        });

        toolbar += ',tbl';
      }

      for (var a = $('.postbody'), i = 0, j = a.length; i < j; i++) {
        if (/\[tbl=.*?\]/i.test(a[i].innerHTML)) {
          a[i].innerHTML = a[i].innerHTML.replace(/\[tbl=(.*?)\]/i, function(M, $1) {
            a[i].style.backgroundImage = 'url(' + $1 + ')';
            return '';
          });
        }
      }
    });

    This will add a button for the [tbl] tag, and parse it client-side as well. However, due to some limitations, the tag was modified to work like this :
    Code:
    [tbl=http://r34.imgfast.net/users/3412/19/22/63/smiles/45347.png]

    It only requires a single tag. After the equal sign is the url of the background image. Give this a try and let me know how it works for you.

    Lastly, if you want to change the button image, add this CSS to your stylesheet :
    Code:
    .sceditor-button-tbl div {
      background-image:url('IMAGE') !important;
    }
    Replace IMAGE with an image URL.
    alla13
    alla13
    Forumember


    Posts : 91
    Reputation : 6
    Language : Arab5/5 Eng3/5 Fr2/5

    Solved Re: help me with this java scripte

    Post by alla13 November 20th 2015, 1:32 pm

    that s what i call magician work
    is working like charme
    one think how can i controle the Dimensions of the background
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    Solved Re: help me with this java scripte

    Post by Ange Tuteur November 20th 2015, 1:39 pm

    By default it'll repeat, and consist of the image's normal dimensions. You can use the following CSS to set a global default :
    Code:
    .postbody {
      background-repeat:no-repeat;
      background-size:cover;
    }

    The above CSS will prevent the image from repeating, and will stretch it to fit the post.
    Michael_vx
    Michael_vx
    Forumember


    Male Posts : 659
    Reputation : 29
    Language : Arabic and some English
    Location : Egypt

    Solved Re: help me with this java scripte

    Post by Michael_vx November 20th 2015, 2:37 pm

    Ange Tuteur wrote:Impossible ..? Sounds like whoever said that never tried to achieve the "impossible.." help me with this java scripte 45347
    thats because there is almost no coders there is like 2 people are only and they are able to use HTML or CSS only
    the botton works 100%
    its only make line break i think but still worls fine
    also sorry for jumping in the topic
    alla13
    alla13
    Forumember


    Posts : 91
    Reputation : 6
    Language : Arab5/5 Eng3/5 Fr2/5

    Solved Re: help me with this java scripte

    Post by alla13 November 20th 2015, 3:19 pm

    if it possible to controle the width help me with this java scripte 1f605 
    i will be thankfull
    alla13
    alla13
    Forumember


    Posts : 91
    Reputation : 6
    Language : Arab5/5 Eng3/5 Fr2/5

    Solved Re: help me with this java scripte

    Post by alla13 November 21st 2015, 3:46 pm

    bumps
    alla13
    alla13
    Forumember


    Posts : 91
    Reputation : 6
    Language : Arab5/5 Eng3/5 Fr2/5

    Solved Re: help me with this java scripte

    Post by alla13 November 23rd 2015, 11:20 am

    bumps
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    Solved Re: help me with this java scripte

    Post by Ange Tuteur November 23rd 2015, 1:56 pm

    replace the script with this :
    Code:
    $(function() {
      if ($.sceditor) {
        $.sceditor.command.set('tbl', {
     
          exec : function() {
            this.insert('[tbl="','" size="100% 100%"]');
          },
     
          txtExec : function() {
            this.insert('[tbl="','" size="100% 100%"]');
          },
     
          tooltip : 'Button title'
     
        });
     
        toolbar += ',tbl';
      }
     
      for (var a = $('.postbody'), i = 0, j = a.length; i < j; i++) {
        if (/\[tbl=".*?" size=".*?"\]/i.test(a[i].innerHTML)) {
          a[i].innerHTML = a[i].innerHTML.replace(/\[tbl="(.*?)" size="(.*?)"\]/i, function(M, $1) {
            a[i].style.backgroundImage = 'url(' + $1 + ')';
            a[i].style.backgroundSize = $2;
            return '';
          });
        }
      }
    });

    Then you should be able to specify the size via the size attribute. Ex :
    Code:
    [tbl="..." size="100% 100%"]
    alla13
    alla13
    Forumember


    Posts : 91
    Reputation : 6
    Language : Arab5/5 Eng3/5 Fr2/5

    Solved Re: help me with this java scripte

    Post by alla13 November 26th 2015, 12:13 pm

    it s working but Cause the disappearance of posting box
    help me with this java scripte IWkDaNI
    alla13
    alla13
    Forumember


    Posts : 91
    Reputation : 6
    Language : Arab5/5 Eng3/5 Fr2/5

    Solved Re: help me with this java scripte

    Post by alla13 November 28th 2015, 10:31 am

    Bumps
    alla13
    alla13
    Forumember


    Posts : 91
    Reputation : 6
    Language : Arab5/5 Eng3/5 Fr2/5

    Solved Re: help me with this java scripte

    Post by alla13 November 29th 2015, 10:32 am

    Bumps
    alla13
    alla13
    Forumember


    Posts : 91
    Reputation : 6
    Language : Arab5/5 Eng3/5 Fr2/5

    Solved Re: help me with this java scripte

    Post by alla13 December 2nd 2015, 10:58 am

    Bumps
    SLGray
    SLGray
    Administrator
    Administrator


    Male Posts : 51498
    Reputation : 3523
    Language : English
    Location : United States

    Solved Re: help me with this java scripte

    Post by SLGray December 2nd 2015, 11:02 am

    Did you set the JavaScript for all pages or in topics?  It needs to be set for all pages.

    Also do you have other JavaScripts?



    help me with this java scripte Slgray10

    When your topic has been solved, ensure you mark the topic solved.
    Never post your email in public.
    alla13
    alla13
    Forumember


    Posts : 91
    Reputation : 6
    Language : Arab5/5 Eng3/5 Fr2/5

    Solved Re: help me with this java scripte

    Post by alla13 December 2nd 2015, 11:08 am

    1-when i set it for all pages do not work
    2- yes i have other java scripts
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    Solved Re: help me with this java scripte

    Post by Ange Tuteur December 3rd 2015, 2:04 pm

    I'm getting A LOT of errors on your forum. Could you try testing this script on a forum that isn't heavily modified to see if it's working as you want it ?
    help me with this java scripte Captur11

    In regards to the errors, I'd recommend retracing your steps and undoing your most recent changes. It looks more like the jQuery library isn't defined. Think
    alla13
    alla13
    Forumember


    Posts : 91
    Reputation : 6
    Language : Arab5/5 Eng3/5 Fr2/5

    Solved Re: help me with this java scripte

    Post by alla13 December 8th 2015, 12:28 pm

    topic solved
    brandon_g
    brandon_g
    Manager
    Manager


    Male Posts : 10113
    Reputation : 923
    Language : English
    Location : USA

    Solved Re: help me with this java scripte

    Post by brandon_g December 9th 2015, 7:36 pm

    Topic solved and archived ~ brandon_g



    help me with this java scripte Brando10
    Remember to mark your topic help me with this java scripte Solved15 when a solution is found.
    General Rules | Tips & Tricks | FAQ | Forgot Founder Password?

    help me with this java scripte Scre1476
    Team Leader
    Review Section Rules | Request A Review | Sticker Points

      Current date/time is September 23rd 2024, 3:36 am