The help section indicates that jQuery should be available. From the help section on DSTs:
"jQuery: We use jQuery extensively, and it is available for use in your DST's javascript, so feel free."
I can see jQuery being used in characters.js. What do I have to do to get it working in my own JS?
Just entering the fray with my own DST at the moment. Its for Eclipse Phase and, while its mostly all going well so far, i'm having two small issues with it.
Here's a pic: "LINK":http://i42.photobucket.com/albums/e348/Micky_TK/ep_dst_ss_1.png
On the left is my testing document, on the right is my test character here on the website.
Seems like I'm picking up some formatting from the site stylesheets.... any suggestions?
Also... where is the description text going? I keep entering stuff there and it vanishes when i click save.
Working on the skills section now. Starting to feel like this really needs a database or something, heh.
Any javascript gurus out there who feel like they can help? Mostly just for stuff like plugging certain values into the skills area and then totalling them up - to save having to enter a bajillion numbers manually, mostly :)
I've been also thinking about putting together a DST for NPC characters, and it'd be cool if we could have it split into two pieces somehow, using certain flags in the code, so that one part of the DST is in the public section, and another part of the DST is down in the GM only area.
So the public and players would be the basic info of the NPC, but really important crunch like stats and powers and attacks would go down in the GM-only bit.
How easy would this be to do, do you think? Making the public part is easy, we can do that already, but allowing for a GM-only area within the DST?
Cool idea! This could be supported server side, but it would be even better to simply expose a variable to the javascript indicating whether or not the current user is a GM or the owner of the character. That would allow DST developers to show, hide, or modify individual fields as well as sections. Unauthorized players could, in theory, still get at the secret data, but they'd have to go to moderately extraordinary means to do so, and we're not launching nuclear missiles here.
Well, mostly along the lines of trying to get the form / input areas to match up in height and width and align with the div or span that they're nesting inside.
I'd also kinda like better support for multi-line text entry or lists or something, but that feels like more of a fantasy somehow.
Once the latest round of updates for my character sheet are approved, I can invite you into the test campaign and you can see for yourself :)
The trick with the inputs is that the code will take the height and width set for the the _span_ tag that's being converted, but only if they're explicitly set in the CSS. If you loook at the _div.ds_chainsawxiv_exalted .typeq_ style in my sheets' "CSS":http://www.obsidianportal.com/dynamic_sheet_templates/2, you'll see that's what I've done there - set an explicit height and width, and used inline block display so that the span itself (which is normally dynamically sized) also takes those values. This works well for the most part, but if data may line-wrap inside the element, you'll want to leave off the height or set it using _min-height_, in which case you're stuck with a slight change in height between the input and the normal display. The jEditable code doesn't take all the factors into consideration for dynamically sized elements.
I've engineered my own javaScript solutions for both lists and multi-line text, which you're welcome to use if you like. You can get them right out of the script section on the page linked above. If you have any questions, feel free to drop me a PM, and I'll be happy to help you through the setup.
I'm not sure that would work well with my sheet, pretty much all my heights and widths are elastic or percentage based.... Looking at yours, you seem to have a series of pre-set sizes that you're setting on the input areas using extra classes? I guess i might have to do that too, but again using em or % values instead of pixels.
Would it be possible to get the data payload added to the options of _dataPreLoad? It would be easy to get around the requirement to hardcode the number of feats/weapons/etc. by simply storing the number of each relevant data point and allowing the preload function to peek and reconstruct the form to accommodate the incoming data.
For example, you could have a table row that contains fields named dsf_weapon_1_name, dsf_weapon_1_damage, dsf_weapon_1_weight, etc. and a single field named dsf_weapon_count. As each new row is added via javascript (dsf_weapon_2... dsf_weapon_3..., etc.) that field is incremented. Then, during _dataPreLoad, you check the value of data.weapon_count and create a new, properly-formatted row for each of the expected incoming values.
The list functionality used in "my sheets":http://www.obsidianportal.com/dynamic_sheet_templates/2 does something along the lines of what you're talking about actually. Technically, it just keeps looking for numbered entries until there aren't any more, but the net result is the same - non-fixed, dynamic lists.
I came up with a solution. Check out "the code":http://www.obsidianportal.com/dynamic_sheet_templates/75 and "the results":http://www.obsidianportal.com/campaigns/wastelanders/characters/nik and let me know what you think.
So what's the simplest way to toggle visibility of one of three divs, given that we can't use html IDs as hooks for javascript? I'm a bit new to working with javascript and CSS and this is doing my head in.
In the callback functions, you get an 'options' parameter. This is an object and one of the properties is 'containerID'. That will tell you the ID of the current sheet, which is important if there are multiples on the same page. Using jQuery, you can do something like this:
Just make sure that the three divs you want to manipulate have unique classes assigned to them. That will function as pseudo-IDs relative to the parent container. Check out the aous_dataPreLoad function in my "the code" link above to see how I'm doing that for the read-only display.
Just to check has anyone used AP Div? Looks to me like a very simple way to make sheets. Make a image of the sheet and then just draw on the AP Div boxes that you need over the sheet. The only thing is that I am not sure how it will work since if the z-index is moved to another spot in the page it will change were the div boxes show up at. I have no way of telling if the wiki setup will change its z-index or the page for the character that you open is kinda like a frame with its own properties in the browser. I have never worked with a wiki setup before.
I've created a DST for Spirit of the Century and submitted it for approval a few weeks ago (March 19). However, I've heard nothing back yet. Presumably the OP guys are working on their huge infrastructure upgrades, so I'm not expecting instant turn-around, but I would think approving a new DST would go pretty quickly. For someone starting a new campaign, it would be very helpful to have it available to my players sooner rather than later. Thanks!
There is something different between here and the developer kit. On the Hero System 4e sheet I just submitted when I use the developer kit it works fine, but here it looks really wrong.
@Sorwen, it's probably a styling issue. The OP site's CSS can interfere with your DST. I had the same issue, and I just had to use Chrome's inspector (Firebug works too) to find out which styles to override in my own DST's CSS.
Edit: Maybe it is because it is too long. When I go back in to edit it doesn't show all of the code.
Edit2: Finally got it trimmed down enough the whole sheet fits, but it is still not formatted right. Forgot to try Firebug. I'll need to try that tonight.
I got my DST approved and was wondering what the process was for updating it? If I update it does the DST suddenly become unavailable to all players or does it start to version with the players having access to the latest approved while I have access to the working DST?
@ChrisCzerniak
Saw this on the DST edit form: "If you're modifying a previously approved DST, then everyone else uses the most recent approved version."
I was also wondering what is the preferred way to get a value from the DOM. I know we aren't suppose to use ids and using jquery throws an error. Are people using getElementByClassName functions?
Comments
"jQuery: We use jQuery extensively, and it is available for use in your DST's javascript, so feel free."
I can see jQuery being used in characters.js. What do I have to do to get it working in my own JS?
Just entering the fray with my own DST at the moment. Its for Eclipse Phase and, while its mostly all going well so far, i'm having two small issues with it.
Here's a pic: "LINK":http://i42.photobucket.com/albums/e348/Micky_TK/ep_dst_ss_1.png
On the left is my testing document, on the right is my test character here on the website.
Seems like I'm picking up some formatting from the site stylesheets.... any suggestions?
Also... where is the description text going? I keep entering stuff there and it vanishes when i click save.
Working on the skills section now. Starting to feel like this really needs a database or something, heh.
Any javascript gurus out there who feel like they can help? Mostly just for stuff like plugging certain values into the skills area and then totalling them up - to save having to enter a bajillion numbers manually, mostly :)
I've been also thinking about putting together a DST for NPC characters, and it'd be cool if we could have it split into two pieces somehow, using certain flags in the code, so that one part of the DST is in the public section, and another part of the DST is down in the GM only area.
So the public and players would be the basic info of the NPC, but really important crunch like stats and powers and attacks would go down in the GM-only bit.
How easy would this be to do, do you think? Making the public part is easy, we can do that already, but allowing for a GM-only area within the DST?
"CLICK HERE":http://purplefox.squarespace.com/storage/filedump/npc_dst.jpg
Btw, ChainsawXIV, how do you style your input fields and form stuff so well? Thats causing me real trouble, heh.
I'd also kinda like better support for multi-line text entry or lists or something, but that feels like more of a fantasy somehow.
Once the latest round of updates for my character sheet are approved, I can invite you into the test campaign and you can see for yourself :)
I've engineered my own javaScript solutions for both lists and multi-line text, which you're welcome to use if you like. You can get them right out of the script section on the page linked above. If you have any questions, feel free to drop me a PM, and I'll be happy to help you through the setup.
For example, you could have a table row that contains fields named dsf_weapon_1_name, dsf_weapon_1_damage, dsf_weapon_1_weight, etc. and a single field named dsf_weapon_count. As each new row is added via javascript (dsf_weapon_2... dsf_weapon_3..., etc.) that field is incremented. Then, during _dataPreLoad, you check the value of data.weapon_count and create a new, properly-formatted row for each of the expected incoming values.
Bam, complex arrays done simply.
$("#" + options['containerId'] + " .myDiv1").hide();
Just make sure that the three divs you want to manipulate have unique classes assigned to them. That will function as pseudo-IDs relative to the parent container. Check out the aous_dataPreLoad function in my "the code" link above to see how I'm doing that for the read-only display.
Let me know if you have further questions.
Just trying to help out.
Can someone please help and create a "standard" Gumshoe character sheet?
Edit: Maybe it is because it is too long. When I go back in to edit it doesn't show all of the code.
Edit2: Finally got it trimmed down enough the whole sheet fits, but it is still not formatted right. Forgot to try Firebug. I'll need to try that tonight.
Saw this on the DST edit form: "If you're modifying a previously approved DST, then everyone else uses the most recent approved version."
I was also wondering what is the preferred way to get a value from the DOM. I know we aren't suppose to use ids and using jquery throws an error. Are people using getElementByClassName functions?