L3010
New Member
Posts: 49
inherit
264353
0
Mar 4, 2023 7:57:32 GMT -8
L3010
49
May 2021
l3010
|
Post by L3010 on Apr 19, 2022 7:12:46 GMT -8
Hi!
My question
Is there a way to create ProBoard's popup-boxes with Javascript or Jquerry? If that's not possible, how can i do it by creating a plugin?
(What i want to make):
In boards where guests are not allowed to make threads i want to display a popup-box when guests clock on the button for creating a new thread, saying that they're not allowed to instead of bringing them to the page that says that they don't have permission to greate a new thread.
Leo
|
|
inherit
Official Code Helper
65613
0
1
Oct 22, 2024 1:56:19 GMT -8
Chris
"'Oops' is the sound we make when we improve"
9,022
December 2005
horace
RedBassett's Mini-Profile
|
Post by Chris on Apr 19, 2022 7:52:33 GMT -8
Proboards Alert BoxEdit: Access to the proboards namespace is being phased out so we should really be using pb.window.alert() instead of proboards.alert()As a more concrete example, let's examine the alert function. Alert is part of the window class, so we call it like this:pb.window.alert(); But wait! Alert has a required parameter, text. Required parameters must always be passed into a function; the function will either throw an error or won't work correctly without them. We can see that the text parameter is of the type String, so it must be passed in inside of quotes (or double quotes):pb.window.alert('This is the text of my alert box.'); So now we have a usable alert box. But looking at the function description, we can see that alert can take in three parameters: title, text, and options. Title and options are both optional, and we've already given our box some text. Let's next give the alert box a title. Both of these parameters are Strings, so they must be passed in inside of quotes:pb.window.alert('Alert Box Title', 'This is the text of my alert box. Look how long it is.'); Now the title and the text show up, but our text is wrapping to a second line and our height is larger than we need. Let's fix that by passing in some options. A quick look at our function description shows that options is an Object. An Object is basically a hash of keys paired with values following a standard JSON syntax. If we want to set our alert box to 400 pixels wide by 125 pixels tall, simply do the following:pb.window.alert('Alert Box Title', 'This is the text of my alert box. Look how long it is.', { width: 400, height: 125 }); Now that you've seen how to call this function, you should be able to extend these skills to any other function listed in the API. If you get into trouble, you can always post here for help.
|
|
inherit
201984
0
Sept 11, 2023 1:23:07 GMT -8
P̌̓aͧś̀t̀u͒le͆o͂2̀3̃̓
Using My Talents Elsewhere
3,314
November 2013
pastuleo23
|
Post by P̌̓aͧś̀t̀u͒le͆o͂2̀3̃̓ on Apr 19, 2022 14:38:23 GMT -8
You will still need to determine if they have permission and cancel the onclick event with javascript on dom ready
|
|