inherit
Peabrained Codebreaker
107114
0
Mar 11, 2020 7:47:27 GMT -8
Boy_Wonder
6,249
July 2007
natzy24
|
Post by Boy_Wonder on Nov 28, 2017 7:15:16 GMT -8
How would I go by field name, as I'd need to check each field seperate to append to proper area <script> $(document).ready(function(){ for(a=0;a<pb.data('user').custom_field_names.length;a++) { if(pb.data('user').custom_field_names[a].toLowerCase().replace(/ /g,'')=='bio') $('.custom-field-'+pb.data('user').custom_field_names[a].toLowerCase().replace(/ /g,'')).clone(true).appendTo('#hide-or-show') if(pb.data('user').custom_field_names[a].toLowerCase().replace(/ /g,'')=='partymember1') $('.custom-field-'+pb.data('user').custom_field_names[a].toLowerCase().replace(/ /g,'')).clone(true).appendTo('#hide-or-show') if(pb.data('user').custom_field_names[a].toLowerCase().replace(/ /g,'')=='partymember2') $('.custom-field-'+pb.data('user').custom_field_names[a].toLowerCase().replace(/ /g,'')).clone(true).appendTo('#hide-or-show') if(pb.data('user').custom_field_names[a].toLowerCase().replace(/ /g,'')=='partymember3') $('.custom-field-'+pb.data('user').custom_field_names[a].toLowerCase().replace(/ /g,'')).clone(true).appendTo('#hide-or-show') } $('#'+$('.form_user_edit_'+pb.data('user').username).attr('id')+'_submit_button').clone(true).appendTo('#hide-or-show').attr('value', 'Save Bio') }) </script> all lowercase with no spaces for id names Okay got it all working, apart from some small final requests - how could I hide all the cloned custom fields off they're originating area and the button(s) aren't actually working to save the information
|
|
inherit
2671
0
May 14, 2013 14:40:03 GMT -8
Peter
🐺
10,615
February 2002
peter3
|
Post by Peter on Nov 28, 2017 8:49:43 GMT -8
|
|
inherit
Peabrained Codebreaker
107114
0
Mar 11, 2020 7:47:27 GMT -8
Boy_Wonder
6,249
July 2007
natzy24
|
Post by Boy_Wonder on Nov 28, 2017 11:16:03 GMT -8
Thanks Peter - though alas in my case I was more looking on the edit profile page rather then the profile page, but never the less I'm sure I'll put this to work
|
|
inherit
2671
0
May 14, 2013 14:40:03 GMT -8
Peter
🐺
10,615
February 2002
peter3
|
Post by Peter on Nov 28, 2017 12:55:15 GMT -8
If you don't want the view side being touched, then edit the plugin and change this line...
if (this.edit_profile() || this.view_profile()) {
To...
if (this.edit_profile()) {
Should solve that for you.
|
|
inherit
Peabrained Codebreaker
107114
0
Mar 11, 2020 7:47:27 GMT -8
Boy_Wonder
6,249
July 2007
natzy24
|
Post by Boy_Wonder on Nov 28, 2017 20:17:28 GMT -8
If you don't want the view side being touched, then edit the plugin and change this line... if (this.edit_profile() || this.view_profile()) { To... if (this.edit_profile()) { Should solve that for you. My other issue is that as I say (and I have 90% of it working through html I need to be able to assign different groups of fields to different locations on the page to avoid having a tonne of tabs) This is the none functioning version (in that the cloned save button doesn't work)
|
|
inherit
2671
0
May 14, 2013 14:40:03 GMT -8
Peter
🐺
10,615
February 2002
peter3
|
Post by Peter on Nov 29, 2017 1:19:37 GMT -8
Boy_Wonder , You can mess with the HTML around this line... github.com/PopThosePringles/ProBoards-Custom-Field-Tabs/blob/master/src/Custom_Field_Tabs.js#L28The forEach loop is just looping over the fields for that specific tab, so you can tweak the HTML to lay them out how you want. I had a feeling my plugin wasn't going to be a solution for you, so no worries. Was interesting to do. It also gave me a good reason to use MutationObservers to observe the saving status, which seems to be pretty good, especially the performance (though it is only observing the child list in one element).
|
|
inherit
2671
0
May 14, 2013 14:40:03 GMT -8
Peter
🐺
10,615
February 2002
peter3
|
Post by Peter on Nov 29, 2017 3:58:25 GMT -8
|
|
inherit
Peabrained Codebreaker
107114
0
Mar 11, 2020 7:47:27 GMT -8
Boy_Wonder
6,249
July 2007
natzy24
|
Post by Boy_Wonder on Nov 29, 2017 8:52:04 GMT -8
Thanks Peter! It works amazing now! So I have to ask for one last thing because I'm horrible this isn't important but is there any way to change the button text for each field?
|
|
inherit
2671
0
May 14, 2013 14:40:03 GMT -8
Peter
🐺
10,615
February 2002
peter3
|
Post by Peter on Nov 30, 2017 5:28:22 GMT -8
|
|