inherit
153968
0
Nov 19, 2012 15:03:05 GMT -8
Thesealion
New Phone Who Dis?
4,124
April 2010
joemaggio
|
Post by Thesealion on Nov 9, 2012 10:34:10 GMT -8
I haven't done anything with this stuff in a looooong time And V5 is all new. Right now i am wondering if there is a way to check whether a person is staff on the post page? Or would that have to be done by adding staff names to the code?
Also how do you check what page you are on? Like right now i think you'd do something like if(pb_action="post") { I don't know how that works now Found it
|
|
inherit
153968
0
Nov 19, 2012 15:03:05 GMT -8
Thesealion
New Phone Who Dis?
4,124
April 2010
joemaggio
|
Post by Thesealion on Nov 9, 2012 13:41:42 GMT -8
Ok new questions I have this code: $(document).ready(function() { if(proboards.data('user').is_staff == '1') { if(proboards.data('page').thread) { $('li.button.button-insertImage').hide(); $('li.button.button-insertVideo').hide(); } } }); when i put it in the JS part of the plugin it doesn't work, but when i put it in the footer it does...why? One other thing. I have been looking for hours for a way to inspect the contents of the posting box for something before it posts...
|
|
inherit
2671
0
May 14, 2013 14:40:03 GMT -8
Peter
🐺
10,615
February 2002
peter3
|
Post by Peter on Nov 9, 2012 15:44:40 GMT -8
The visual editor controls are generated via Javascript. You are using the "ready" event, which is fired once the DOM is ready, that's why it works in the footer, and not above.
The "posting box" contains 2 things, a textarea, and an iframe. Depending on what you want to do, you may need to look at both of them.
The iframe is not obvious at first look, but this gives you an idea of how to get the contents of that.
$(".editor.visual-editor iframe").contents().find("body").html()
Like I said, there is a textarea as well to look at which is what is submitted.
|
|
inherit
153968
0
Nov 19, 2012 15:03:05 GMT -8
Thesealion
New Phone Who Dis?
4,124
April 2010
joemaggio
|
Post by Thesealion on Nov 9, 2012 16:30:28 GMT -8
Is there another way to get it to work in the other box?
Ok what I am trying to do is check to see if someone uses image or video tags in a post and then block the posting...
|
|
inherit
153968
0
Nov 19, 2012 15:03:05 GMT -8
Thesealion
New Phone Who Dis?
4,124
April 2010
joemaggio
|
Post by Thesealion on Nov 14, 2012 11:57:58 GMT -8
bump...
|
|