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 23, 2016 9:19:32 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 Apr 23, 2016 9:29:44 GMT -8
Okay so given this is for users to tick things off individually i'd be using a private user key (as long as that can still display in a side bar but just be used to store the information on whats ticked.
I still don't get the whole how to write to a key though. Like I don't get what value I'd be using
|
|
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 23, 2016 10:01:41 GMT -8
Okay so given this is for users to tick things off individually i'd be using a private user key (as long as that can still display in a side bar but just be used to store the information on whats ticked. I still don't get the whole how to write to a key though. Like I don't get what value I'd be using If you don't want access to their list u want a private user key. You can save a string, object, or array. Pb.plugin.key(name).set(stringOrArrayOrObject) So what data are you saving
|
|
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 Apr 23, 2016 10:03:39 GMT -8
//Document Ready $( document ).ready(function() { var toDoList = pb.plugin.get('to_do_list').settings; //Problems to Fix p1 - create various tabs for the check lists as needed dynamically var tab1lngthinfo = toDoList.unapp_chkbox; console.log(tab1lngthinfo.length); //P5 - Output all information (done...ish) $("#ToDoTest").append("<div class='container'><div class='title-bar'><h2>To Do List(s)</h2></div><div class='content cap-bottom' id='toDoBox'></div>"); $("#toDoBox").append("<div id='tabs'><ul><li><a href='#unapp'>Unapproved Members To Do List</a></li><li><a href='#daily'>Daily To Do List</a></li></ul></div><div id='unapp'>If you're a new member please fill in the checkboxes to help yourself get adjusted and settled in!</div><div id='daily'>Eventually the Daily Checkbox will come here</div>"); //P2 - Generate checkboxes to mark if a task has been done or not for(a=0;a<pb.plugin.get('to_do_list').settings.unapp_chkbox.length;a++){ $('#unapp').append('<input type="checkbox" id="'+pb.plugin.get('to_do_list').settings.unapp_chkbox[a].checkbox_id+'"value="'+pb.plugin.get('to_do_list').settings.unapp_chkbox[a].checkbox_label+'" ><label for="'+pb.plugin.get('to_do_list').settings.unapp_chkbox[a].checkbox_id+'">'+pb.plugin.get('to_do_list').settings.unapp_chkbox[a].checkbox_label+'<br /></label></form>'); }
//P3 - Check if all checkboxes have been ticked and store to key. Each tickbox needs to store that its been ticked pb.plugin.key('ToDoListKey').set({ value: 'value' });
//P4 - API to send money to users (maybe give a trophy if possible? Need to talk to Peter });
Okay this part:
for(a=0;a<pb.plugin.get('to_do_list').settings.unapp_chkbox.length;a++){ $('#unapp').append('<input type="checkbox" id="'+pb.plugin.get('to_do_list').settings.unapp_chkbox[a].checkbox_id+'"value="'+pb.plugin.get('to_do_list').settings.unapp_chkbox[a].checkbox_label+'" ><label for="'+pb.plugin.get('to_do_list').settings.unapp_chkbox[a].checkbox_id+'">'+pb.plugin.get('to_do_list').settings.unapp_chkbox[a].checkbox_label+'<br /></label></form>'); }
Is what's generating the checkboxes.
It needs to save whenever someone ticks a checkbox (and that checkbox should then be disabled. There will be a second list of checkboxes made for daily tasks but that's neither here nor there (I'll ask for help on that bridge when I hit it basically).
It will also need to effectively save once someone completes all the checkboxes and a monetary award (at least) is given out to save it.
|
|
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 23, 2016 10:23:02 GMT -8
Okay so given this is for users to tick things off individually i'd be using a private user key (as long as that can still display in a side bar but just be used to store the information on whats ticked. I still don't get the whole how to write to a key though. Like I don't get what value I'd be using If you don't want access to their list u want a private user key. You can save a string, object, or array. Pb.plugin.key(name).set(stringOrArrayOrObject) So what data are you saving So you have a list that will change or never change. If it never changes use an array. Otherwise use an object.
|
|
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 Apr 23, 2016 10:35:52 GMT -8
Okay but how do I identify it - do I just set as an object (I'm not sure if it will change or not XD)
Edit will it look like this:
pb.plugin.key('ToDoListKey').set({ value: 'object' });
Or do I need to make an object with a name?
|
|
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 23, 2016 10:38:21 GMT -8
Okay but how do I identify it - do I just set as an object (I'm not sure if it will change or not XD) Well you write an object from scratch. And you save the value 1 for checked. But naming is up to 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 Apr 23, 2016 10:40:10 GMT -8
Right so I create a javascript object that's right?
var car = {type:"Fiat", model:"500", color:"white"}; ^ Create something like that? ((Not exactly that but))
|
|
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 23, 2016 10:51:57 GMT -8
Right so I create a javascript object that's right? var car = {type:"Fiat", model:"500", color:"white"}; ^ Create something like that? ((Not exactly that but)) Exactly but instead of 500 it would be 1
|
|
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 Apr 23, 2016 10:57:27 GMT -8
Right - like this: pb.plugin.key('ToDoListKey').set({ value: 'value' }); var unappCheck ="value:1";
or do you mean that this:
pb.plugin.key('ToDoListKey').set({ value: 'value' });
Should become like this:
pb.plugin.key('ToDoListKey').set({ value: '1' });
Can you tell me which is right? As this is how I'll start to remember things
|
|
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 23, 2016 11:17:08 GMT -8
Right - like this: pb.plugin.key('ToDoListKey').set({ value: 'value' }); var unappCheck ="value:1"; or do you mean that this: pb.plugin.key('ToDoListKey').set({ value: 'value' }); Should become like this: pb.plugin.key('ToDoListKey').set({ value: '1' }); Can you tell me which is right? As this is how I'll start to remember thingss Set({Value:{'box1':1}}) Like that but phone is hard to type
|
|
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 Apr 23, 2016 11:29:10 GMT -8
aah I get it now so 'box1' would refer to the first checkbox right?
So how would I make it that it would check through the entire for loop'd of checkboxes to see which are checked and which aren't?
|
|
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 23, 2016 21:19:50 GMT -8
aah I get it now so 'box1' would refer to the first checkbox right? So how would I make it that it would check through the entire for loop'd of checkboxes to see which are checked and which aren't? The is checked I posted before. You would have to loop through $('box'+a)
|
|
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 Apr 23, 2016 22:00:52 GMT -8
aah I get it now so 'box1' would refer to the first checkbox right? So how would I make it that it would check through the entire for loop'd of checkboxes to see which are checked and which aren't? The is checked I posted before. You would have to loop through $('box'+a) Would I be wise then to wrap my key set thingy into an if loop then? As then I could disable the checkbox in one fell swoop
|
|
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 23, 2016 23:40:04 GMT -8
The is checked I posted before. You would have to loop through $('box'+a) Would I be wise then to wrap my key set thingy into an if loop then? As then I could disable the checkbox in one fell swoop That would keep from setting the key however that would not disable the "Appearance" of the box being checked and unchecked. It just wouldn't do anything to your data. (So IF would be an "extra" level of security)
|
|