Obsidian Portal
Menu
Sign In / Create Account
JavaScript is currently disabled. Obsidian Portal has a lot of really cool features that use JavaScript. You should check them out. We think you'll have a much more enjoyable experience.
Home
Campaigns
Games Nearby
Plans
Community
Help
Resources
Solomon Kane
Author:
markspace
Slug:
solomon_kane
Type:
GameCharacter
System:
Savage Worlds
DST Source Code
HTML Template
<div class="content"> <div class="solomon_kane_mast"> <div class="solomon_kane_title"> The Savage World of Solomon Kane </div> <div class="solomon_kane_name"> I, <span class="dsf dsf_name"></span> born on, <span class="dsf dsf_born"></span> in the year of our lord, <span class="dsf dsf_bornyear"></span> in the lands of, <span class="dsf dsf_in_the_lands_of"></span> do hearby swear that this is a true accounting of my knowledge and abilities, and that I have not borne false witness about any item contained herein, upon my honor and the honor of my fellow countrymen </div> </div> <div class="solomon_kane_columns"> <div class="solomon_kane_c1"> <div class="solomon_kane_stats"> <span class="solomon_kane_header">Attributes</span> <div class="solomon_kane_attributes"> <div>Agility <span class="dsf dsf_agility"></span></div> <div>Smarts <span class="dsf dsf_smarts"></span></div> <div>Strength <span class="dsf dsf_strength"></span></div> <div>Spirit <span class="dsf dsf_spirit"></span></div> <div>Vigor <span class="dsf dsf_vigor"></span></div> </div> <div class="solomon_kane_derived"> <div><span class="dsf dsf_charisma"></span> Charisma <span class="dsf dsf_charisma_mod"></span></div> <div><span class="dsf dsf_pace"></span> Pace <span class="dsf dsf_pace_mod"></span></div> <div><span class="dsf dsf_parry"></span> Parry <span class="dsf dsf_parry_mod"></span></div> <div><span class="dsf dsf_toughness"></span> Toughness <span class="dsf dsf_toughness_mod"></span></div> </div> </div> <div class="solomon_kane_skills"> <span class="solomon_kane_header">Skills</span> <div class="solomon_kane_skills_c1"> <div><span class="solomon_kane_custom dsf dsf_skill1_name"></span> <span class="dsf dsf_skill1"></span></div> <div><span class="solomon_kane_custom dsf dsf_skill2_name"></span> <span class="dsf dsf_skill2"></span></div> <div><span class="solomon_kane_custom dsf dsf_skill3_name"></span> <span class="dsf dsf_skill3"></span></div> <div><span class="solomon_kane_custom dsf dsf_skill4_name"></span> <span class="dsf dsf_skill4"></span></div> <div><span class="solomon_kane_custom dsf dsf_skill5_name"></span> <span class="dsf dsf_skill5"></span></div> <div><span class="solomon_kane_custom dsf dsf_skill6_name"></span> <span class="dsf dsf_skill6"></span></div> <div><span class="solomon_kane_custom dsf dsf_skill7_name"></span> <span class="dsf dsf_skill7"></span></div> <div><span class="solomon_kane_custom dsf dsf_skill8_name"></span> <span class="dsf dsf_skill8"></span></div> </div> <div class="solomon_kane_skills_c2"> <div><span class="solomon_kane_custom dsf dsf_skill9_name"></span> <span class="dsf dsf_skill9"></span></div> <div><span class="solomon_kane_custom dsf dsf_skill10_name"></span> <span class="dsf dsf_skill10"></span></div> <div><span class="solomon_kane_custom dsf dsf_skill11_name"></span> <span class="dsf dsf_skill11"></span></div> <div><span class="solomon_kane_custom dsf dsf_skill12_name"></span> <span class="dsf dsf_skill12"></span></div> <div><span class="solomon_kane_custom dsf dsf_skill13_name"></span> <span class="dsf dsf_skill13"></span></div> <div><span class="solomon_kane_custom dsf dsf_skill14_name"></span> <span class="dsf dsf_skill14"></span></div> <div><span class="solomon_kane_custom dsf dsf_skill15_name"></span> <span class="dsf dsf_skill15"></span></div> <div><span class="solomon_kane_custom dsf dsf_skill16_name"></span> <span class="dsf dsf_skill16"></span></div> </div> </div> <div class="solomon_kane_possessions"> <div class="solomon_kane_earthly"> <span class="solomon_kane_header">Earthly Possessions</span> <div><span class="solomon_kane_area readonly dsf dsf_possessions"></span></div> </div> <div class="solomon_kane_armor"> <span class="solomon_kane_header">Armor</span> <div>Head <span class="dsf dsf_armor_head"></span></div> <div>Torso <span class="dsf dsf_armor_torso"></span></div> <div>Arms <span class="dsf dsf_armor_arms"></span></div> <div>Legs <span class="dsf dsf_armor_legs"></span></div> <br> <div>Total WT <span class="dsf dsf_wt_carried"></span></div> <div>Weight Limit <span class="dsf dsf_wt_limit"></span></div> <div>Enc Penalty <span class="dsf dsf_enc_penalty"></span></div> </div> </div> <div class="solomon_kane_powers"> <span class="solomon_kane_header">Powers/Trappings</span> <div><span class="solomon_kane_area readonly dsf dsf_powers"></span></div> </div> </div> <div class="solomon_kane_c2"> <div class="solomon_kane_hindrances"> <span class="solomon_kane_header">Hindrances</span> <div><span class="solomon_kane_area readonly dsf dsf_hindrances"></span></div> </div> <div class="solomon_kane_edges"> <span class="solomon_kane_header">Edges</span> <div><span class="solomon_kane_area readonly dsf dsf_edges"></span></div> </div> <div class="solomon_kane_scars"> <span class="solomon_kane_header">Scars</span> <div><span class="solomon_kane_area readonly dsf dsf_scars"></span></div> </div> </div> </div> <div class="solomon_kane_weapons"> <span class="solomon_kane_header">Weapons</span> <div><span class="solomon_kane_area readonly dsf dsf_weapons"></span></div> </div> <div class="solomon_kane_end"></div> </div>
CSS
/**************************** * This is the CSS for the solomon_kane *****************************/ @media print { body * { visibility: hidden; } div.dynamic_sheet_container * { visibility: visible; } div.dynamic_sheet_container { position: absolute; left: 0; top: 0; } .ds_solomon_kane { width: 700px; font-family: "Times New Roman", Times, serif; font-size:14pt; line-height:normal; } } @media screen { .ds_solomon_kane { width: 700px; font-family: "Times New Roman", Times, serif; font-size:14pt; line-height:normal; } } .ds_solomon_kane .jeditable_input{ right:-2px; top:-1px; height:14px; } .ds_solomon_kane input { padding:0px 0px 0px 0px; margin:-1px 0px 0px -1px; } div.editable .dsf { cursor:pointer; font-weight: bold; } div.editable .dsf:hover { color:#456d67; font-weight: bold; } div.editable .dsf_bio:hover { color:#456d67; cursor:text; font-weight: bold; } div.editable .area:hover{ color:#456d67; font-weight: bold; } .ds_solomon_kane .jeditable_input , .solomon_kane_textarea { font-weight: bold; font-family: "Times New Roman", Times, serif !important; font-size:14pt !important; } .ds_solomon_kane .solomon_kane_title { width: 30%; font-size: 150%; font-weight: bold; color: black; text-align: center; margin-bottom: .25em; float: left; } .ds_solomon_kane .solomon_kane_name { width: 70%; float: right; } .ds_solomon_kane .solomon_kane_columns { clear: both; width: 100%; } /* Columns */ .ds_solomon_kane .solomon_kane_c1 { width: 475px; margin-right: 10px; float: left; } .ds_solomon_kane .solomon_kane_c2 { width: 215px; float: left; } .ds_solomon_kane .solomon_kane_attributes { width: 230px; margin-right: 15px; float: left; } .ds_solomon_kane .solomon_kane_dreived { width: 230px; float: left; } .ds_solomon_kane .solomon_kane_skills_c1 { width: 230px; margin-right: 15px; float: left; } .ds_solomon_kane .solomon_kane_skills_c2 { width: 230px; float: left; } .ds_solomon_kane .solomon_kane_earthly { width: 230px; margin-right: 15px; float: left; } .ds_solomon_kane .solomon_kane_armor { width: 230px; float: left; } .ds_solomon_kane .solomon_kane_skills { clear: both; } .ds_solomon_kane .solomon_kane_possessions { clear: both; } .ds_solomon_kane .solomon_kane_powers { clear: both; } .ds_solomon_kane .solomon_kane_header { width: 100%; font-size: 110%; font-weight: bold; background-color: #E8E8E8; color: black; float: left; text-align: center; margin-bottom: .25em; } .ds_solomon_kane .solomon_kane_hidden { display: none; visibility: hidden; } .ds_solomon_kane .solomon_kane_area { float: left; position:relative; display:inline-block; text-align:left; width: 100%; color:inherit; } .ds_solomon_kane .solomon_kane_end { clear: both; } .ds_solomon_kane .solomon_kane_attributes div>span:last-of-type, .ds_solomon_kane .solomon_kane_skills_c1 div>span:last-of-type, .ds_solomon_kane .solomon_kane_skills_c2 div>span:last-of-type { min-width: 1em; margin-left: .5em; font-weight: bold; float:right; text-align:right; display:inline-block; } .ds_solomon_kane .solomon_kane_armor div>span:last-of-type { min-width: 40%; margin-left: .5em; font-weight: bold; float:right; text-align:right; display:inline-block; } .ds_solomon_kane .solomon_kane_derived div { text-align:center; } .ds_solomon_kane .solomon_kane_derived div>span { display:inline-block; font-weight: bold; min-width: 1em; } .ds_solomon_kane .solomon_kane_attributes div, .ds_solomon_kane .solomon_kane_derived div, .ds_solomon_kane .solomon_kane_skills_c1 div, .ds_solomon_kane .solomon_kane_skills_c2 div, .ds_solomon_kane .solomon_kane_armor div { clear: right; border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: #E0E0E0; } .solomon_kane_custom { min-width: 70%; font-weight: normal; display:inline-block; }
Javascript
/* * This is the javascript specific to the solomon_kane DST * by Mark Davidson * * Lots of ideas from Langy and ChainsawXIV */ // Global Storage solomon_kane_context = {}; var $ = jQuery var solomon_kane_default_values = { "name" : "NAME", "born" : "DAY", "bornyear" : "YEAR", "in_the_lands_of" : "PLACE", "agility" : "d4", "smarts" : "d4", "strength" : "d4", "spirit" : "d4", "vigor" : "d4", "charisma" : "0", "charisma_mod" : "0", "pace" : "6", "pace_mod" : "0", "parry" : "2", "parry_mod" : "0", "toughness" : "4", "toughness_mod" : "0", "skill1_name" : "Fighting", "skill1" : "d4", "skill2_name" : "Shooting", "skill2" : "d4", "skill3_name" : "Guts", "skill3" : "d4", "hindrances" : "HINDERANCE<br><br><br>", "edges" : "EDGE<br><br><br>N<br>5<br>10<br>15<br>S<br>25<br>30<br>35<br>V<br>45<br>50<br>55<br>H<br>65<br>70<br>75<br>L<br>90<br>100<br>110<br>", "possessions" : "POSSESSIONS", "powers" : "POWERS", "weapons" : "WEAPONS", "scars" : "SCARS ETC", "armor_head" : "", "armor_torso" : "", "armor_arms" : "", "armor_legs" : "", "wt_carried" : "0", "wt_limit" : "20", "enc_penalty" : "0", }; function solomon_kane_dataPreLoad(opts) { $.fn.editable.defaults['onblur'] = 'submit'; aisleten.characters.jeditablePlaceholder = "__"; aisleten.characters.jeditableSubmit = ''; // Called just before the data is loaded. var tempData = {}; for (var val in solomon_kane_default_values) { tempData[val] = solomon_kane_default_values[val]; } for (var val in dynamic_sheet_attrs) { tempData[val] = dynamic_sheet_attrs[val]; } dynamic_sheet_attrs = tempData; } function solomon_kane_dataPostLoad(opts) { var containerId = "#" + opts['containerId']; solomon_kane_context = document.getElementById(opts['containerId']); opts['context'] = document.getElementById(opts['containerId']); //Convert interface elements solomon_kane_convertAreas(opts); // Modify the image attributes so that it is scaled to fit inside // the pre-allocated space on the character sheet var avatarImgActual = '.avatar_image'; var avatarImg = jQuery(avatarImgActual); var width = avatarImg.width(); var height = avatarImg.height(); if (width > height) { jQuery(avatarImgActual).css("width", "100%"); } else { jQuery(avatarImgActual).css("height", "100%"); } solomon_kane_derivedStats(); } function solomon_kane_dataPreSave(opts) { opts['context'] = document.getElementById(opts['containerId']); solomon_kane_unconvertAreas(opts); var containerId = "#" + opts['containerId']; } function solomon_kane_area(oElement,opts){ // Store opts oElement.setAttribute('optsIsEditable',opts['isEditable']); oElement.setAttribute('optsDebugThreshold',opts['debugThreshold']); // Attaches edit events to area text oElement.activate = function(){ // Don't activate the element if we're not in edit mode if (this.getAttribute('optsIsEditable') != 'true') return; // Activate the element oElement.onclick = this.edit; // Add default value if (this.innerHTML == '') this.innerHTML = aisleten.characters.jeditablePlaceholder; // Set the element's alt text this.title = 'Edit'; // Set the cursor for the item this.style.cursor = 'pointer'; }; // Converts the element to an editable area oElement.edit = function(){ // Abort click function if we just clicked submit if(this.getAttribute('eventLock') == 'locked'){ this.setAttribute('eventLock',null); return; } // Force submit any other area in the context var aAreas = solomon_kane_getElementsByClassName('area','span'); for (var i = 0; i < aAreas.length; i++){ if (aAreas[i].getAttribute('status') == 'editing') aAreas[i].submit(); } // Set the editing flag this.setAttribute('status','editing'); // Disable click functionality this.onclick = null; // Set cursor this.style.cursor = 'text'; // Remove default if (this.innerHTML == aisleten.characters.jeditablePlaceholder) this.innerHTML = ''; // Convert <br /> tags to line breaks var sText = this.innerHTML.replace(/<br>/g,'\n'); // Select dimensions and classes var iWidth = this.offsetWidth + parseInt(this.getAttribute('widthMod')); var iHeight = this.offsetHeight + parseInt(this.getAttribute('heightMod')) + 60; var sClasses = this.getAttribute('areaClasses'); // Convert content into form with button this.innerHTML = '<textarea class=solomon_kane_textarea "' + sClasses + '" style="width:' + iWidth + 'px;height:' + iHeight + 'px;">' + sText + '</textarea>'; var focusRef = function(){$('.solomon_kane_textarea').focus();}; var submitRef = function(){$('.solomon_kane_textarea').parent().submit();}; var unfocusRef = function(){$('.solomon_kane_textarea').blur(submitRef)}; this.focusTimeout = setTimeout(focusRef,50); this.unfocusTimeout = setTimeout(unfocusRef,60); }; // Converts the edit box back into regular text form oElement.submit = function(){ // Get the data from the edit box var sContent = this.getElementsByTagName('textarea')[0].value.replace(/\n/g,'<br>'); // Remove the form elements this.innerHTML = sContent; // Reapply the default value if needed if (this.innerHTML == '') this.innerHTML = aisleten.characters.jeditablePlaceholder; // Lock out the click event until we're done this.setAttribute('eventLock','locked'); // Automatically unlock after a twentieth of a second var submitRef = function(){oElement.setAttribute('eventLock',null);}; this.timeout = setTimeout(submitRef,50); // Set pointer this.style.cursor = 'pointer'; // Reattach the click functionality this.onclick = this.edit; // Reset the editing flag this.setAttribute('status',null); // Call the onUpdate event this.onUpdate(); }; // On Update event function, typicaly overriden oElement.onUpdate = function(){ } // Error handling function - alerts on errors if bug reporting is on oElement.error = function(iImportance,sText){ if (this.getAttribute('optsDebugThreshold')) var iThreshold = this.getAttribute('debugThreshold'); else iThreshold = 0; if (iImportance < iThreshold){ alert(sText); } } // Return the element for ease of refference return oElement; } // Converts all properly classed divs in the context to areas function solomon_kane_convertAreas(opts){ // Find all the spans on the page with "area" in their class name if (opts['context']) var aSpans = opts['context'].getElementsByTagName('span'); else var aSpans = document.getElementsByTagName('span'); var taTemp = {}; for (var i = 0; i < aSpans.length; i++){ if (aSpans[i].className.match(/area/)){ // Convert each element to a full featured area object taTemp = solomon_kane_area(aSpans[i],opts); taTemp.activate(); // Load up custom parameters and such depending on class if (aSpans[i].className.match('is_tooltip')){ taTemp.setAttribute('widthMod',-9); taTemp.setAttribute('heightMod',-9); taTemp.setAttribute('areaClasses','area tip_area'); taTemp.onUpdate = function(){ oParent = this.parentNode; oParent.setAttribute("editLock","unlocked"); oParent.mouseOut(); }; } else{ taTemp.setAttribute('widthMod',-23); taTemp.setAttribute('heightMod',-6); taTemp.setAttribute('areaClasses','area'); } } } } // Sets the necesary class name on areas for them to be saved function solomon_kane_unconvertAreas(opts){ // Find all the spans on the page with "area" in their class name if (opts['context']) var aSpans = opts['context'].getElementsByTagName('span'); else var aSpans = document.getElementsByTagName('span'); // Add the necesary save key to the class name // Also close out any active edit boxes for (var i = 0; i < aSpans.length; i++){ if (aSpans[i].className.match(/area/)){ //if (aSpans[i].innerHTML.match(/textarea/)) aSpans[i].submit(); if (aSpans[i].innerHTML == aisleten.characters.jeditablePlaceholder) aSpans[i].innerHTML = ''; } } } //////////////////////////////////////////////////////// // General Utility Functions :: Credit to ChainsawXIV // //////////////////////////////////////////////////////// // Gets an array of elements with a particular class from the context function solomon_kane_getElementsByClassName(sClassName,sElementType){ // Provide default element type if (!sElementType) sElementType = 'div'; var aList = new Array(); var aDivs = solomon_kane_context.getElementsByTagName(sElementType); for (var i = 0; i < aDivs.length; i++){ if (aDivs[i].className.match(sClassName)) aList[aList.length] = aDivs[i]; } return aList; }
Submit Notes
Back