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.

help me with this java scripte

5 posters

Go down

Solved help me with this java scripte

Post by alla13 Sun Nov 15, 2015 5:16 am

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 Wed Dec 09, 2015 10:34 am; edited 4 times in total
alla13
alla13
Forumember

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

http://alla-omar.mo-rpg.com

Back to top Go down

Solved Re: help me with this java scripte

Post by alla13 Mon Nov 16, 2015 5:30 am

bumps
alla13
alla13
Forumember

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

http://alla-omar.mo-rpg.com

Back to top Go down

Solved Re: help me with this java scripte

Post by alla13 Tue Nov 17, 2015 5:35 am

alla13
alla13
Forumember

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

http://alla-omar.mo-rpg.com

Back to top Go down

Solved Re: help me with this java scripte

Post by Ange Tuteur Tue Nov 17, 2015 6:52 am

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
Ange Tuteur
Ange Tuteur
Forumaster

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

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: help me with this java scripte

Post by alla13 Tue Nov 17, 2015 7:10 am

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

http://alla-omar.mo-rpg.com

Back to top Go down

Solved Re: help me with this java scripte

Post by alla13 Wed Nov 18, 2015 8:04 am

Bump
alla13
alla13
Forumember

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

http://alla-omar.mo-rpg.com

Back to top Go down

Solved Re: help me with this java scripte

Post by alla13 Thu Nov 19, 2015 12:42 pm

Bumps
alla13
alla13
Forumember

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

http://alla-omar.mo-rpg.com

Back to top Go down

Solved Re: help me with this java scripte

Post by Michael_vx Thu Nov 19, 2015 5:49 pm

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
Michael_vx
Michael_vx
Forumember

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

Back to top Go down

Solved Re: help me with this java scripte

Post by alla13 Fri Nov 20, 2015 3: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
alla13
alla13
Forumember

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

http://alla-omar.mo-rpg.com

Back to top Go down

Solved Re: help me with this java scripte

Post by Ange Tuteur Fri Nov 20, 2015 6:00 am

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.
Ange Tuteur
Ange Tuteur
Forumaster

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

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: help me with this java scripte

Post by alla13 Fri Nov 20, 2015 6:32 am

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

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

http://alla-omar.mo-rpg.com

Back to top Go down

Solved Re: help me with this java scripte

Post by Ange Tuteur Fri Nov 20, 2015 6:39 am

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.
Ange Tuteur
Ange Tuteur
Forumaster

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

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: help me with this java scripte

Post by Michael_vx Fri Nov 20, 2015 7:37 am

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
Michael_vx
Michael_vx
Forumember

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

Back to top Go down

Solved Re: help me with this java scripte

Post by alla13 Fri Nov 20, 2015 8:19 am

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

http://alla-omar.mo-rpg.com

Back to top Go down

Solved Re: help me with this java scripte

Post by alla13 Sat Nov 21, 2015 8:46 am

bumps
alla13
alla13
Forumember

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

http://alla-omar.mo-rpg.com

Back to top Go down

Solved Re: help me with this java scripte

Post by alla13 Mon Nov 23, 2015 4:20 am

bumps
alla13
alla13
Forumember

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

http://alla-omar.mo-rpg.com

Back to top Go down

Solved Re: help me with this java scripte

Post by Ange Tuteur Mon Nov 23, 2015 6:56 am

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%"]
Ange Tuteur
Ange Tuteur
Forumaster

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

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: help me with this java scripte

Post by alla13 Thu Nov 26, 2015 5:13 am

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

http://alla-omar.mo-rpg.com

Back to top Go down

Solved Re: help me with this java scripte

Post by alla13 Sat Nov 28, 2015 3:31 am

Bumps
alla13
alla13
Forumember

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

http://alla-omar.mo-rpg.com

Back to top Go down

Solved Re: help me with this java scripte

Post by alla13 Sun Nov 29, 2015 3:32 am

Bumps
alla13
alla13
Forumember

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

http://alla-omar.mo-rpg.com

Back to top Go down

Solved Re: help me with this java scripte

Post by alla13 Wed Dec 02, 2015 3:58 am

Bumps
alla13
alla13
Forumember

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

http://alla-omar.mo-rpg.com

Back to top Go down

Solved Re: help me with this java scripte

Post by SLGray Wed Dec 02, 2015 4: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.
SLGray
SLGray
Administrator
Administrator

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

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

Solved Re: help me with this java scripte

Post by alla13 Wed Dec 02, 2015 4:08 am

1-when i set it for all pages do not work
2- yes i have other java scripts
alla13
alla13
Forumember

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

http://alla-omar.mo-rpg.com

Back to top Go down

Solved Re: help me with this java scripte

Post by Ange Tuteur Thu Dec 03, 2015 7:04 am

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
Ange Tuteur
Ange Tuteur
Forumaster

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

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: help me with this java scripte

Post by alla13 Tue Dec 08, 2015 5:28 am

topic solved
alla13
alla13
Forumember

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

http://alla-omar.mo-rpg.com

Back to top Go down

Solved Re: help me with this java scripte

Post by brandon_g Wed Dec 09, 2015 12: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
brandon_g
brandon_g
Manager
Manager

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

https://www.broadcastingduo.com

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum