HTML preprocessors can make writing HTML more powerful or convenient. For instance, Markdown is designed to be easier to write and read for text documents and you could write a loop in Pug.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. So you don't have access to higher-up elements like the <html>
tag. If you want to add classes there that can affect the whole document, this is the place to do it.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. If you need things in the <head>
of the document, put that code here.
The resource you are linking to is using the 'http' protocol, which may not work when the browser is using https.
CSS preprocessors help make authoring CSS easier. All of them offer things like variables and mixins to provide convenient abstractions.
It's a common practice to apply CSS to a page that styles elements such that they are consistent across all browsers. We offer two of the most popular choices: normalize.css and a reset. Or, choose Neither and nothing will be applied.
To get the best cross-browser support, it is a common practice to apply vendor prefixes to CSS properties and values that require them to work. For instance -webkit-
or -moz-
.
We offer two popular choices: Autoprefixer (which processes your CSS server-side) and -prefix-free (which applies prefixes via a script, client-side).
Any URLs added here will be added as <link>
s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.
You can apply CSS to your Pen from any stylesheet on the web. Just put a URL to it here and we'll apply it, in the order you have them, before the CSS in the Pen itself.
You can also link to another Pen here (use the .css
URL Extension) and we'll pull the CSS from that Pen and include it. If it's using a matching preprocessor, use the appropriate URL Extension and we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
JavaScript preprocessors can help make authoring JavaScript easier and more convenient.
Babel includes JSX processing.
Any URL's added here will be added as <script>
s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.
You can apply a script from anywhere on the web to your Pen. Just put a URL to it here and we'll add it, in the order you have them, before the JavaScript in the Pen itself.
If the script you link to has the file extension of a preprocessor, we'll attempt to process it before applying.
You can also link to another Pen here, and we'll pull the JavaScript from that Pen and include it. If it's using a matching preprocessor, we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
Search for and use JavaScript packages from npm here. By selecting a package, an import
statement will be added to the top of the JavaScript editor for this package.
Using packages here is powered by esm.sh, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ESM usage.
All packages are different, so refer to their docs for how they work.
If you're using React / ReactDOM, make sure to turn on Babel for the JSX processing.
If active, Pens will autosave every 30 seconds after being saved once.
If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.
If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.
Visit your global Editor Settings.
<div class="page-container">
<div class="header-container"><div class="save-button">Save</div></div>
<div class="navigator-container">
</div>
<div class="form-container">
<div class="form-section" data-title="Intervention Details" data-section="intervention details">
<div class="header">Intervention Details</div>
<div class="table-item">
<table class="multiple-items">
<tr>
<td class="label">Caregiver</td>
<td><select data-input-name="caregiver" data-input-type="select"></select></td>
</tr>
<tr>
<td class="label">Client</td>
<td><select data-input-name="client" data-input-type="select"></select></td>
</tr>
<tr>
<td class="label">Date</td>
<td><input type="text" data-input-name="date" data-input-type="text"/></td>
</tr>
</table>
</div>
</div>
<div class="form-section" data-title="Endocrine" data-section="history">
<div class="header">Endocrine (Check All That Apply)</div>
<div class="check-item" data-form-item="iddm" data-display="IDDM"></div>
<div class="check-item" data-form-item="niddm" data-display="NIDDM"></div>
<div class="check-item" data-form-item="thyroid"></div>
<div class="check-item" data-form-item="endocrine_other" data-display="Other"></div>
</div>
<div class="form-section" data-title="Skeletal" data-section="history">
<div class="header">Skeletal (Check All That Apply)</div>
<div class="check-item" data-form-item="fractures"></div>
<div class="check-item" data-form-item="surgery"></div>
<div class="check-item" data-form-item="osteoarthritis"></div>
<div class="check-item" data-form-item="deformity"></div>
<div class="check-item" data-form-item="osteoporosis"></div>
<div class="check-item" data-form-item="skelatal_other" data-display="Other"></div>
</div>
<div class="form-section" data-title="Neurological" data-section="history">
<div class="header">Neurological (Check All That Apply)</div>
<div class="check-item" data-form-item="neuropathy"></div>
<div class="check-item" data-form-item="cva" data-display="CVA"></div>
<div class="check-item" data-form-item="ms" data-display="MS"></div>
<div class="check-item" data-form-item="paralysis"></div>
<div class="check-item" data-form-item="parkinsons" data-display="Parkinson\'s"></div>
<div class="check-item" data-form-item="dementia"></div>
<div class="check-item" data-form-item="neurological_other" data-display="Other"></div>
</div>
<div class="form-section" data-title="Cardiovascular" data-section="history">
<div class="header">Cardiovascular (Check All That Apply)</div>
<div class="check-item" data-form-item="angina"></div>
<div class="check-item" data-form-item="mi" data-display="MI"></div>
<div class="check-item" data-form-item="htn" data-display="HTN"></div>
<div class="check-item" data-form-item="pvd" data-display="PVD"></div>
<div class="check-item" data-form-item="pacemaker"></div>
<div class="check-item" data-form-item="cardiovascular_other" data-display="Other"></div>
</div>
<div class="form-section" data-title="Respiratory" data-section="history">
<div class="header">Respiratory (Check All That Apply)</div>
<div class="check-item" data-form-item="asthma"></div>
<div class="check-item" data-form-item="COPD" data-display="COPD"></div>
<div class="check-item" data-form-item="cardiac_asthma" data-display="Cardiac Asthma"></div>
<div class="check-item" data-form-item="emboli"></div>
<div class="check-item" data-form-item="respiratory_other" data-display="Other"></div>
</div>
<div class="form-section" data-title="Sensory" data-section="history">
<div class="header">Sensory (Check All That Apply)</div>
<div class="check-item" data-form-item="poor_eyesight" data-display="Poor Eyesight"></div>
<div class="check-item" data-form-item="hearing_loss" data-display="Hearing Loss"></div>
<div class="check-item" data-form-item="sensory_other" data-display="Other"></div>
</div>
<div class="form-section" data-title="Communicable Diseases" data-section="history">
<div class="header">Communicable Diseases (Check All That Apply)</div>
<div class="check-item" data-form-item="hepatitis"></div>
<div class="check-item" data-form-item="mrsa" data-display="MRSA"></div>
<div class="check-item" data-form-item="vre" data-display="VRE"></div>
<div class="check-item" data-form-item="communicable_diseases_other" data-display="Other"></div>
</div>
<div class="form-section" data-title="Mobility and Footwear" data-section="assessment">
<div class="header">Mobility and Footwear</div>
<div class="select-item" data-form-item="ambulatory_status">
<span>Ambulatory Status</span>
<select data-input-name="ambulatory_status" data-input-type="select">
<option value="">Select One</option>
<option value="ambulatory">Ambulatory</option>
<option value="non_ambulatory">Non-Ambulatory</option>
</select>
</div>
<div class="check-item" data-form-item="leg_activity" data-display="Does the condition of the feet/legs limit activity?"></div>
<div class="check-item" data-form-item="gait_disturbance" data-display="Observe gait with shoes on \'gait disturbance\'?"></div>
<div class="check-item" data-form-item="mobility_and_footwear_other" data-display="Other"></div>
</div>
<div class="form-section" data-title="Current Footwear" data-section="assessment">
<div class="header">Current Footwear (Check All That Apply)</div>
<div class="check-item" data-form-item="wide_toe_box" data-display="Wide Toe Box"></div>
<div class="check-item" data-form-item="good_depth" data-display="Good Depth"></div>
<div class="check-item" data-form-item="good_arch_support" data-display="Good Arch Support"></div>
<div class="check-item" data-form-item="no_rubbing" data-display="No Rubbing"></div>
<div class="check-item" data-form-item="uneven_wear" data-display="Uneven wear on soles, heals, and/or inside of shoes"></div>
<div class="check-item" data-form-item="current_footwear_other" data-display="Other"></div>
</div>
<div class="form-section" data-title="Dermatological Assessment & General Appearace" data-section="assessment">
<div class="header">Dermatological Assessment & General Appearace</div>
<div class="check-item" data-form-item="skin_intact" data-display="Skin is intact, clean, and hydrated"></div>
<div class="form-item" data-form-item="general_skin">
<span>General Skin</span>
<div class="multi-select" data-input-name="general_skin" data-input-type="multi-select-radio" data-radio=true><span data-value="dry">Dry</span><span data-value="normal">Normal</span><span data-value="moist">Moist</span><span data-value="other">Other</span></div>
</div>
<div class="check-item" data-form-item="adequate_soft_tissue" data-display="Adequate Soft Tissue"></div>
<div class="check-item" data-form-item="ulcer"></div>
<div class="check-item" data-form-item="fissures" data-display="Fissures on heels"></div>
<div class="check-item" data-form-item="excoriation" data-display="Excoriation on legs or feet"></div>
<div class="check-item" data-form-item="corns"></div>
<div class="check-item" data-form-item="planters_wart" data-display="Planters wart"></div>
<div class="check-item" data-form-item="calluses"></div>
<div class="check-item" data-form-item="dermatological_other" data-display="Other"></div>
<div class="check-item" data-form-item="foot_sore_more" data-display="Ever had a foot sore that took more than 2 weeks to heal?"></div>
<div class="sub-header">Toe Nails</div>
<div class="check-item" data-form-item="nails_trimmed_correctly" data-display="Nails trimmed correctly"></div>
<div class="left-right-item" data-form-item="nail_condition">
<table>
<tr>
<td><div class="multi-select" data-input-name="ingrown_right" data-input-type="multi-select"><span data-value="R5">R5</span><span data-value="R4">R4</span><span data-value="R3">R3</span><span data-value="R2">R2</span><span data-value="R1">R1</span></div></td>
<td>Ingrown</td>
<td><div class="multi-select" data-input-name="ingrown_left" data-input-type="multi-select"><span data-value="L1">L1</span><span data-value="L2">L2</span><span data-value="L3">L3</span><span data-value="L4">L4</span><span data-value="L5">L5</span></div></td>
</tr>
<tr>
<td><div class="multi-select" data-input-name="infection_right" data-input-type="multi-select"><span data-value="R5">R5</span><span data-value="R4">R4</span><span data-value="R3">R3</span><span data-value="R2">R2</span><span data-value="R1">R1</span></div></td>
<td>Infection</td>
<td><div class="multi-select" data-input-name="infection_left" data-input-type="multi-select"><span data-value="L1">L1</span><span data-value="L2">L2</span><span data-value="L3">L3</span><span data-value="L4">L4</span><span data-value="L5">L5</span></div></td>
</tr>
<tr>
<td><div class="multi-select" data-input-name="overgrown_right" data-input-type="multi-select"><span data-value="R5">R5</span><span data-value="R4">R4</span><span data-value="R3">R3</span><span data-value="R2">R2</span><span data-value="R1">R1</span></div></td>
<td>Overgrown</td>
<td><div class="multi-select" data-input-name="overgrown_left" data-input-type="multi-select"><span data-value="L1">L1</span><span data-value="L2">L2</span><span data-value="L3">L3</span><span data-value="L4">L4</span><span data-value="L5">L5</span></div></td>
</tr>
<tr>
<td><div class="multi-select" data-input-name="thickened_right" data-input-type="multi-select"><span data-value="R5">R5</span><span data-value="R4">R4</span><span data-value="R3">R3</span><span data-value="R2">R2</span><span data-value="R1">R1</span></div></td>
<td>Thickened</td>
<td><div class="multi-select" data-input-name="thickened_left" data-input-type="multi-select"><span data-value="L1">L1</span><span data-value="L2">L2</span><span data-value="L3">L3</span><span data-value="L4">L4</span><span data-value="L5">L5</span></div></td>
</tr>
<tr>
<td><div class="multi-select" data-input-name="discoloured_right" data-input-type="multi-select"><span data-value="R5">R5</span><span data-value="R4">R4</span><span data-value="R3">R3</span><span data-value="R2">R2</span><span data-value="R1">R1</span></div></td>
<td>Discoloured</td>
<td><div class="multi-select" data-input-name="discolured_left" data-input-type="multi-select"><span data-value="L1">L1</span><span data-value="L2">L2</span><span data-value="L3">L3</span><span data-value="L4">L4</span><span data-value="L5">L5</span></div></td>
</tr>
<tr>
<td><div class="multi-select" data-input-name="involuted_right" data-input-type="multi-select"><span data-value="R5">R5</span><span data-value="R4">R4</span><span data-value="R3">R3</span><span data-value="R2">R2</span><span data-value="R1">R1</span></div></td>
<td>Involuted</td>
<td><div class="multi-select" data-input-name="involuted_left" data-input-type="multi-select"><span data-value="L1">L1</span><span data-value="L2">L2</span><span data-value="L3">L3</span><span data-value="L4">L4</span><span data-value="L5">L5</span></div></td>
</tr>
<tr>
<td><div class="multi-select" data-input-name="rams_horn_right" data-input-type="multi-select"><span data-value="R5">R5</span><span data-value="R4">R4</span><span data-value="R3">R3</span><span data-value="R2">R2</span><span data-value="R1">R1</span></div></td>
<td>Rams Horn</td>
<td><div class="multi-select" data-input-name="rams_horn_left" data-input-type="multi-select"><span data-value="L1">L1</span><span data-value="L2">L2</span><span data-value="L3">L3</span><span data-value="L4">L4</span><span data-value="L5">L5</span></div></td>
</tr>
</table>
</div>
<div class="sub-header">Structure Deformities</div>
<div class="check-item" data-form-item="boney_prominances" data-display="Boney prominances"></div>
<div class="check-item" data-form-item="hallus_vulgus" data-display="Hallus vulgus (bunion)"></div>
<div class="check-item" data-form-item="hammer_toes" data-display="Hammer toes"></div>
<div class="check-item" data-form-item="overlapping_digits" data-display="Overlapping digits"></div>
<div class="check-item" data-form-item="tailor_bunionette" data-display="Tailor bunionette"></div>
</div>
<div class="form-section" data-title="Circulatory Status of Feet and Legs" data-section="assessment">
<div class="header">Circulatory Status of Feet and Legs</div>
<div class="form-item" data-form-item="capillary_refill">
<table>
<tr>
<td></td>
<td class="text-bold">Capillary Refill</td>
</tr>
<tr>
<td class="text-right">Right Foot</td>
<td><div class="multi-select" data-input-name="capillary_refill_right" data-input-type="multi-select-radio" data-radio=true><span data-value="-3">-3 sec</span><span data-value="3">+3 sec</span></div></td>
</tr>
<tr>
<td class="text-right">Left Foot</td>
<td><div class="multi-select" data-input-name="capillary_refill_left" data-input-type="multi-select-radio" data-radio=true><span data-value="-3">-3 sec</span><span data-value="3">+3 sec</span></div></td>
</tr>
</table>
</div>
<div class="form-item" data-form-item="pedul_pulses">
<table>
<tr>
<td></td>
<td colspan=2 class="text-bold text-center">Pedul Pulses</td>
</tr>
<tr>
<td></td>
<td>Right Foot</td>
<td>Left Foot</td>
</tr>
<tr>
<td class="text-right">Dorsalis pedis pulse</td>
<td class="text-center"><input type="checkbox" data-input-name="dorsalis_pedis_right" data-input-type="checkbox" /></td>
<td class="text-center"><input type="checkbox" data-input-name="dorsalis_pedis_left" data-input-type="checkbox" /></td>
</tr>
<tr>
<td class="text-right">Posterior tibial pulse</td>
<td class="text-center"><input type="checkbox" data-input-name="posterior_tibial_right" data-input-type="checkbox" /></td>
<td class="text-center"><input type="checkbox" data-input-name="posterior_tibial_left" data-input-type="checkbox" /></td>
</tr>
</table>
</div>
<div class="check-item" data-form-item="calf_pain" data-display="Do you have pain in the calf when walking or exertion that is relieved by rest within minutes?">
<span>Assess for intermittent claudication</span>
</div>
<div class="check-item" data-form-item="pain_relief_bed" data-display="Do you have pain when you go to bed at night relieved by putting your foot over the side of the bed?"></div>
<div class="left-right-item" data-form-item="toe_pain">
<span>Do you have toe pain?</span>
<table>
<tr>
<td><div class="multi-select" data-input-name="toe_pain_right" data-input-type="multi-select"><span data-value="R5">R5</span><span data-value="R4">R4</span><span data-value="R3">R3</span><span data-value="R2">R2</span><span data-value="R1">R1</span></div></td>
<td>Rate the pain</td>
<td><div class="multi-select" data-input-name="toe_pain_left" data-input-type="multi-select"><span data-value="L1">L1</span><span data-value="L2">L2</span><span data-value="L3">L3</span><span data-value="L4">L4</span><span data-value="L5">L5</span></div></td>
</tr>
</table>
</div>
<div class="form-item" data-form-item="anticoagulant">
<span>Do you use an anticoagulant?</span>
<table class="anticoagulant">
<tbody>
<tr>
<td class="text-bold text-center">Name of drug</td>
<td class="text-bold text-center">Dosage</td>
</tr>
<!--<tr>
<td><input type="text" name="name" value="test" /></td>
<td><input type="text" name="dosage" /></td>
<td class="vert-middle"><div class="delete-anticoagulant">x</div></td>
</tr>-->
</tbody>
</table>
</div>
<div class="check-item" data-form-item="edema"></div>
<div class="check-item" data-form-item="varocities"></div>
<div class="check-item" data-form-item="spider_veins" data-display="Spider Veins"></div>
<div class="check-item" data-form-item="feet_temperature" data-display="Are feet the same temperature?"></div>
<div class="check-item" data-form-item="leg_temperature" data-display="Are legs the same temperature?"></div>
<div class="form-item" data-form-item="hair_growth">
<span>Hair growth (foot/toes)</span>
<table>
<tr>
<td class="text-center">Right Foot</td>
<td class="text-center">Left Foot</td>
</tr>
<tr>
<td><div class="multi-select" data-input-name="hair_growth_right" data-input-type="multi-select-radio" data-radio=true><span data-value="normal">Normal</span><span data-value="sparce">Sparce</span><span data-value="absent">Absent</span></div></td>
<td><div class="multi-select" data-input-name="hair_growth_left" data-input-type="multi-select-radio" data-radio=true><span data-value="normal">Normal</span><span data-value="sparce">Sparce</span><span data-value="absent">Absent</span></div></td>
</tr>
</table>
</div>
<div class="form-item" data-form-item="foot_colour">
<table>
<tr>
<td></td>
<td class="text-bold text-center" colspan=2>Colour</td>
</tr>
<tr>
<td></td>
<td>Right Foot</td>
<td>Left Foot</td>
</tr>
<tr>
<td class="text-right">Hyperpigmentation</td>
<td class="text-center"><input type="checkbox" data-input-name="foot_colour_hyperpigmentation_right" data-input-type="checkbox"/></td>
<td class="text-center"><input type="checkbox" data-input-name="foot_colour_hyperpigmentation_left" data-input-type="checkbox"/></td>
</tr>
<tr>
<td class="text-right">Red</td>
<td class="text-center"><input type="checkbox" data-input-name="foot_colour_red_right" data-input-type="checkbox"/></td>
<td class="text-center"><input type="checkbox" data-input-name="foot_colour_red_left" data-input-type="checkbox"/></td>
</tr>
<tr>
<td class="text-right">Red-Blue on dependency</td>
<td class="text-center"><input type="checkbox" data-input-name="foot_colour_red_blue_right" data-input-type="checkbox"/></td>
<td class="text-center"><input type="checkbox" data-input-name="foot_colour_red_blue_left" data-input-type="checkbox"/></td>
</tr>
<tr>
<td class="text-right">Blue</td>
<td class="text-center"><input type="checkbox" data-input-name="foot_colour_blue_right" data-input-type="checkbox"/></td>
<td class="text-center"><input type="checkbox" data-input-name="foot_colour_blue_left" data-input-type="checkbox"/></td>
</tr>
</table>
</div>
</div>
<div class="form-section" data-title="Neurological Assessment" data-section="assessment">
<div class="header">Neurological Assessment</div>
<div class="check-item" data-form-item="leg_sensation" data-display="Any changes to sensation of legs and feet?"></div>
<div class="form-item" data-form-item="semmes">
<div class="semmes">
<div class="title">Assess using the Semmes-Weinstein 10g Monofilament</div>
<div class="point-container">
<img src="/img/footcare/semmes-feet.png"/>
<div class="test-point" data-input-name="semmes_point_right_1" data-input-type="semmes-point" data-point-number=1><span></span></div>
<div class="test-point" data-input-name="semmes_point_right_2" data-input-type="semmes-point" data-point-number=2><span></span></div>
<div class="test-point" data-input-name="semmes_point_right_3" data-input-type="semmes-point" data-point-number=3><span></span></div>
<div class="test-point" data-input-name="semmes_point_right_4" data-input-type="semmes-point" data-point-number=4><span></span></div>
<div class="test-point" data-input-name="semmes_point_right_5" data-input-type="semmes-point" data-point-number=5><span></span></div>
<div class="test-point" data-input-name="semmes_point_right_6" data-input-type="semmes-point" data-point-number=6><span></span></div>
<div class="test-point" data-input-name="semmes_point_right_7" data-input-type="semmes-point" data-point-number=7><span></span></div>
<div class="test-point" data-input-name="semmes_point_right_8" data-input-type="semmes-point" data-point-number=8><span></span></div>
<div class="test-point" data-input-name="semmes_point_right_9" data-input-type="semmes-point" data-point-number=9><span></span></div>
<div class="test-point" data-input-name="semmes_point_right_10" data-input-type="semmes-point" data-point-number=10><span></span></div>
<div class="test-point" data-input-name="semmes_point_left_1" data-input-type="semmes-point" data-point-number=11><span></span></div>
<div class="test-point" data-input-name="semmes_point_left_2" data-input-type="semmes-point" data-point-number=12><span></span></div>
<div class="test-point" data-input-name="semmes_point_left_3" data-input-type="semmes-point" data-point-number=13><span></span></div>
<div class="test-point" data-input-name="semmes_point_left_4" data-input-type="semmes-point" data-point-number=14><span></span></div>
<div class="test-point" data-input-name="semmes_point_left_5" data-input-type="semmes-point" data-point-number=15><span></span></div>
<div class="test-point" data-input-name="semmes_point_left_6" data-input-type="semmes-point" data-point-number=16><span></span></div>
<div class="test-point" data-input-name="semmes_point_left_7" data-input-type="semmes-point" data-point-number=17><span></span></div>
<div class="test-point" data-input-name="semmes_point_left_8" data-input-type="semmes-point" data-point-number=18><span></span></div>
<div class="test-point" data-input-name="semmes_point_left_9" data-input-type="semmes-point" data-point-number=19><span></span></div>
<div class="test-point" data-input-name="semmes_point_left_10" data-input-type="semmes-point" data-point-number=20><span></span></div>
</div>
<div class="clear"></div>
</div>
</div>
<div class="form-item" data-form-item="foot_sensation">
<table>
<tr>
<td></td>
<td>Right Foot</td>
<td>Left Foot</td>
</tr>
<tr>
<td>Do your feet ever numb?</td>
<td class="text-center"><input type="checkbox" data-input-name="foot_sensation_numb_right" data-input-type="checkbox"/></td>
<td class="text-center"><input type="checkbox" data-input-name="foot_sensation_numb_left" data-input-type="checkbox"/></td>
</tr>
<tr>
<td>Do your feet ever tingle?</td>
<td class="text-center"><input type="checkbox" data-input-name="foot_sensation_tingle_right" data-input-type="checkbox"/></td>
<td class="text-center"><input type="checkbox" data-input-name="foot_sensation_tingle_left" data-input-type="checkbox"/></td>
</tr>
<tr>
<td>Do your feet ever burn?</td>
<td class="text-center"><input type="checkbox" data-input-name="foot_sensation_burn_right" data-input-type="checkbox"/></td>
<td class="text-center"><input type="checkbox" data-input-name="foot_sensation_burn_left" data-input-type="checkbox"/></td>
</tr>
<tr>
<td>Feel like insects crawling on them?</td>
<td class="text-center"><input type="checkbox" data-input-name="foot_sensation_insects_right" data-input-type="checkbox"/></td>
<td class="text-center"><input type="checkbox" data-input-name="foot_sensation_insects_left" data-input-type="checkbox"/></td>
</tr>
</table>
</div>
</div>
<div class="form-section" data-title="Diagram" data-section="diagram and notes">
<div class="header">Diagram</div>
<div class="form-item">
<div class="feet-diagram-container" data-type="top_view">
<div class="feet-diagram">
<div class="title">Top</div>
<div class="diagram-container"><img src="/img/footcare/feet-top.png"/></div>
</div>
<table class="foot-diagram-notes">
<!--<tbody class="hidden">
<tr>
<td class="text-center vert-middle"><div class="feet-diagram-point">1</div></td>
<td><div class="add-picture">Add a picture</div></td>
<td class="diagram-note-input"><div contenteditable data-ph="Notes...">notes</div></td>
<td class="text-center vert-middle"><div class="delete-foot-point">x</div></td>
</tr>
</tbody>-->
</table>
</div>
<div class="feet-diagram-container" data-type="bottom_view">
<div class="feet-diagram">
<div class="title">Bottom</div>
<div class="diagram-container"><img src="/img/footcare/feet-bottom.png"/></div>
</div>
<table class="foot-diagram-notes"></table>
</div>
<div class="feet-diagram-container" data-type="insole_view">
<div class="feet-diagram wide">
<div class="title">Insole</div>
<div class="diagram-container"><img src="/img/footcare/feet-insole.png"/></div>
</div>
<table class="foot-diagram-notes"></table>
</div>
<div class="feet-diagram-container" data-type="outsole_view">
<div class="feet-diagram wide">
<div class="title">Outsole</div>
<div class="diagram-container"><img src="/img/footcare/feet-outsole.png"/></div>
</div>
<table class="foot-diagram-notes"></table>
</div>
</div>
</div>
<div class="form-section" data-title="Notes" data-section="diagram and notes">
<div class="header">Notes</div>
<div class="final-notes" data-input-name="final_notes" data-input-type="contenteditable" contenteditable data-ph="Notes..."></div>
</div>
<div class="form-section" data-title="Transaction" data-section="transaction">
<div class="header">Transaction</div>
<div class="form-item">
<div class="product-wrap">
<input type="hidden" data-input-name="payment_id" data-input-type="text" />
<table class="products">
<thead>
<tr>
<td>Item</td>
<td>Qty</td>
<td>Service/Product</td>
<td class="text-right">Price</td>
<td class="text-right">Extended</td>
<td></td>
</tr>
</thead>
<tbody>
<!--<tr class="product-item">
<td class="text-center vert-middle" data-field="index" data-input-type="contenteditable"></td>
<td><input data-field="quantity" data-input-type="text" type="text"/></td>
<td><select data-field="product" data-input-type="select"></select></td>
<td class="text-right" data-field="price" data-input-type="contenteditable"></td>
<td class="text-right text-bold" data-field="extended" data-input-type="contenteditable"></td>
<td><div class="delete-product">x</div></td>
</tr>-->
</tbody>
</table>
<table class="product-totals">
<tr>
<td class="text-right">Subtotal</td><td data-input-name="subtotal" data-input-type="contenteditable" data-format="currency" class="amount"></td>
</tr>
<tr>
<td class="text-right">HST @ 13%</td><td data-input-name="tax" data-input-type="contenteditable" data-format="currency" class="amount"></td>
</tr>
<tr>
<td class="text-right">Total</td><td data-input-name="total" data-input-type="contenteditable" data-format="currency" class="amount"></td>
</tr>
</table>
<div class="clear"></div>
</div>
</div>
<div class="form-item text-center">
<span>Payment Method</span>
<div class="multi-select" data-input-name="payment_method" data-input-type="multi-select-radio" data-radio=true><span data-value="Cash/Cheque">Cash/Cheque</span><span data-value="Credit">Credit</span><span data-value="COA">COA</span><span data-value="Bill to Family">Bill to Family</span><span data-value="DVA">DVA</span></div>
</div>
<div class="form-item text-center">
<span>Air Miles</span>
<span><input class="text-center" data-input-name="air_miles" data-input-type="text" type="text" /></span>
</div>
</div>
<div class="form-section" data-title="Book Next Appointment">
<div class="header">Book Next Appointment</div>
<div class="form-item text-center">
<span>Would you like to book another appointment?</span>
<div class="multi-select"><span>Book</span><span>Directions</span></div>
</div>
</div>
</div>
</div>
@import url(https://fonts.googleapis.com/css?family=Lato:400,700);
body {
font-family: Lato;
position: absolute;
top: 0px;
bottom: 0px;
right: 0px;
left: 0px;
}
.clear {
clear: both;
}
.left {
float: left;
}
.right {
float: right;
}
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-bold { font-weight: bold; }
.vert-middle { vertical-align: middle; }
.page-container {
position: absolute;
top: 0px;
bottom: 0px;
right: 0px;
left: 0px;
}
.header-container {
height: 45px;
border-bottom: 1px solid #999;
}
.navigator-container {
position: absolute;
left: 0;
width: 225px;
top: 46px;
bottom: 0;
overflow: auto;
-webkit-overflow-scrolling: touch;
}
.form-container {
position: absolute;
border-left: 1px solid #888;
left: 225px;
right: 0px;
top: 46px;
bottom: 0px;
overflow: auto;
-webkit-overflow-scrolling: touch;
}
.save-button {
cursor: pointer;
float: right;
line-height: 45px;
color: hsl(10,80%,50%);
padding: 0 10px;
font-size: 1.1em;
}
.navigator-container .form-item {
position: relative;
cursor: pointer;
width: 100%;
box-sizing: border-box;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.navigator-container .form-item:hover,
.navigator-container .form-item.selected {
background-color: #eee;
}
.navigator-container .header {
background-color: #bbb;
border-color: #aaa;
text-transform: capitalize;
}
[contenteditable]:empty:not(:focus):before {
content:attr(data-ph);
color: #d0d0d0;
}
.diagram-note-input [contenteditable]:empty:not(:focus):before,
.final-notes:empty:not(:focus):before {
color: hsl(45,90%,45%);
}
.image-flip {
-moz-transform: scaleX(-1);
-o-transform: scaleX(-1);
-webkit-transform: scaleX(-1);
transform: scaleX(-1);
filter: FlipH;
-ms-filter: "FlipH";
}
.hidden {
display: none;
}
.header {
background-color: hsl(200,80%,50%);
border: 1px solid hsl(200,60%,50%);
border-left: none;
border-right: none;
color: white;
font-size: 0.9em;
padding: 3px 3px 3px 10px;
}
.check-item,
.select-item,
.radio-item,
.left-right-item,
.sub-header {
position: relative;
margin-left: 10px;
font-size: 1.2em;
line-height: 1.2em;
padding: 12px 50px 12px 0;
border-bottom: 1px solid #ccc;
}
.check-item:last-child,
.select-item:last-child,
.radio-item:last-child,
.left-right-item:last-child {
border-bottom: none;
}
.form-item {
position: relative;
border-bottom: none;
margin: 0;
padding: 12px;
padding-right: 0px;
font-size: 1.2em;
}
.form-item:after {
position: absolute;
content: " ";
bottom: 0px;
left: 10px;
right: 0px;
height: 1px;
background-color: #ccc;
}
.form-item:last-child:after {
display: none;
}
.check-item {
position: relative;
}
.check-item input[type="checkbox"] {
margin-right: 10px;
}
.check-item label {
cursor: pointer;
}
input[type="checkbox"] {
cursor: pointer;
position: relative;
-webkit-appearance: none;
appearance: none;
box-sizing: content-box;
outline: none;
content: " ";
width: 28px;
height: 18px;
background-color: #fff;
border: 1px solid #ddd;
border-radius: 14px;
left: 0;
top: 1px;
/* margin-top: -9px; */
transition: 0.3s;
vertical-align: text-bottom;
}
input[type="checkbox"]:checked {
background-color: hsl(120,65%,55%);
border: 1px solid hsl(120,56%,55%);
}
input[type="checkbox"]:after {
position: absolute;
content: " ";
width: 16px;
height: 16px;
background-color: white;
border: 1px solid #d2d2d2;
border-radius: 16px;
box-shadow: 0px 1px 2px rgba(120,120,120,0.3);
left: 0;
top: 50%;
margin-top: -9px;
transition: 0.3s;
}
input[type="checkbox"]:checked:after {
left: 11px;
}
.sub-header {
font-family: helvetica;
text-align: center;
font-weight: bold;
}
.form-container select {
margin-top: -2px;
font-size: 1.0em;
color: #222;
font-family: Lato;
border: 1px solid #ccc;
border-radius: 5px;
padding: 5px;
}
.radio-item table {
margin-top: 10px;
width: 100%;
text-align: center;
}
.left-right-item table {
text-align: center;
}
.left-right-item > span,
.check-item > span,
.form-item > span {
display: block;
margin-bottom: 10px;
}
.table-item {
font-size: 1.2em;
padding-left: 12px;
}
.table-item .label {
text-align: right;
width: 1px;
}
.table-item table.multiple-items {
width: 100%;
}
.table-item table.multiple-items tr {
border-bottom: 1px solid #ccc;
}
.table-item table.multiple-items tr:last-child {
border-bottom: none;
}
.table-item table.multiple-items td {
padding: 12px;
}
.table-item select,
.table-item input {
box-sizing: border-box;
width: 100%;
}
.multi-select {
display: inline-block;
border: 1px solid hsl(10,80%,50%);
border-radius: 5px;
color: hsl(10,80%,50%);
font-size: 0.8em;
white-space: nowrap;
}
.multi-select span {
cursor: pointer;
display: inline-block;
padding: 6px 12px;
border-right: 1px solid hsl(10,80%,50%);
transition: 0.3s;
}
.multi-select span.selected {
color: white;
background-color: hsl(10,80%,50%);
}
.multi-select span:last-child {
border-right: none;
}
.left-right-item td {
padding: 5px;
}
.form-item td {
padding: 5px;
}
.form-container input[type="text"] {
font-size: 1.0em;
font-family: Lato;
color: #222;
border: 1px solid #ccc;
border-radius: 5px;
padding: 5px;
}
.form-item table input[type="text"] {
box-sizing: border-box;
width: 100%;
}
.semmes {
text-align: center;
}
.title {
text-align: center;
font-family: helvetica;
font-weight: bold;
margin-bottom: 10px;
}
.semmes .point-container {
display: inline-block;
position: relative;
}
.test-point {
cursor: pointer;
position: absolute;
width: 100px;
height: 100px;
background-color: hsla(5,70%,60%,0.5);
border: 1px solid hsla(5,70%,55%,0.55);
border-radius: 100px;
transform: scale(0.6,0.6);
transition: 0.3s;
}
.test-point.selected {
background-color: hsla(120,70%,60%,0.5);
border-color: hsla(120,70%,55%,0.55);
}
.test-point:before {
position: absolute;
content: " ";
width: 50px;
height: 50px;
background-color: hsl(5,60%,50%);
border: 1px solid hsl(5,60%,40%);
border-radius: 50px;
top: 50%;
margin-top: -26px;
left: 50%;
margin-left: -26px;
transition: 0.3s;
}
.test-point.selected:before {
background-color: hsl(120,60%,50%);
border-color: hsl(120,60%,40%);
}
.test-point span {
position: absolute;
content: " ";
width: 26px;
height: 10px;
background-color: hsla(0,0%,100%,1);
top: 50%;
margin-top: -5px;
left: 50%;
margin-left: -13px;
border-radius: 2px;
transition: 0.7s ease-out;
}
.test-point.selected span {
transform: rotateZ(310deg);
margin-left: -9px;
margin-top: -4px;
}
.test-point span:after {
position: absolute;
content: " ";
width: 10px;
height: 10px;
background-color: hsla(0,0%,100%,1);
bottom: 0;
left: 0;
border-radius: 2px;
transition: 0.2s;
/* transition-delay: 0.9s; */
}
.test-point.selected span:after {
height: 18px;
/* transition-delay: 0s; */
}
.test-point[data-point-number="1"] {
top: 35px;
left: 65px;
}
.test-point[data-point-number="2"] {
top: 160px;
left: 100px;
}
.test-point[data-point-number="3"] {
top: 180px;
left: 20px;
}
.test-point[data-point-number="4"] {
top: 230px;
left: -30px;
}
.test-point[data-point-number="5"] {
top: 280px;
left: 89px;
}
.test-point[data-point-number="6"] {
top: 260px;
left: 29px;
}
.test-point[data-point-number="7"] {
top: 300px;
left: -20px;
}
.test-point[data-point-number="8"] {
top: 400px;
left: 50px;
}
.test-point[data-point-number="9"] {
top: 410px;
left: -15px;
}
.test-point[data-point-number="10"] {
top: 560px;
left: 35px;
}
.test-point[data-point-number="11"] {
top: 35px;
right: 65px;
}
.test-point[data-point-number="12"] {
top: 160px;
right: 100px;
}
.test-point[data-point-number="13"] {
top: 180px;
right: 20px;
}
.test-point[data-point-number="14"] {
top: 230px;
right: -30px;
}
.test-point[data-point-number="15"] {
top: 280px;
right: 89px;
}
.test-point[data-point-number="16"] {
top: 260px;
right: 29px;
}
.test-point[data-point-number="17"] {
top: 300px;
right: -20px;
}
.test-point[data-point-number="18"] {
top: 400px;
right: 50px;
}
.test-point[data-point-number="19"] {
top: 410px;
right: -15px;
}
.test-point[data-point-number="20"] {
top: 560px;
right: 35px;
}
.feet-diagram {
text-align: center;
margin: 10px auto;
padding: 10px;
}
.diagram-container {
position: relative;
display: inline-block;
}
.notes {
cursor: pointer;
position: absolute;
right: 10px;
top: 6px;
z-index: 1;
width: 30px;
height: 34px;
opacity: 0.4;
background-color: hsl(45,10%,80%);
border: 1px solid hsl(45,10%,65%);
transition: 0.3s;
}
.notes.open, .notes.content, .notes:hover {
background-color: hsl(45,90%,80%);
border-color: hsl(45,90%,65%);
}
.notes:hover {
opacity: 0.6;
}
.notes:before {
position: absolute;
content: " ";
top: -1px;
right: -1px;
border-top: 6px solid white;
border-right: 6px solid white;
border-bottom: 6px solid transparent;
border-left: 6px solid transparent;
}
.notes:after {
position: absolute;
content: " ";
top: -1px;
right: -1px;
border-left: 6px solid hsl(45,10%,65%);
border-bottom: 6px solid hsl(45,10%,65%);
border-top: 6px solid transparent;
border-right: 6px solid transparent;
transition: 0.3s;
}
.notes.content:after, .notes:hover:after {
border-left-color: hsl(45,90%,65%);
border-bottom-color: hsl(45,90%,65%);
}
.notes.open, .notes.content {
opacity: 1;
}
.notes.open {
cursor: default;
width: 200px;
min-height: 150px;
height: auto;
z-index: 2;
padding: 15px 5px 5px 5px;
}
.notes.open:before, .notes.open:after {
display: none;
}
.note-clipper {
overflow: hidden;
}
.note-input, .notes .close-button {
display: none;
}
.open .note-input {
display: block;
outline: none;
width: 100%;
margin-top: 13px;
min-height: 150px;
min-width: 200px;
line-height: 1.35em;
}
.notes.open .close-button {
cursor: pointer;
display: block;
position: absolute;
top: 3px;
right: 3px;
content: " ";
left: 0;
height: 25px;
/* border: 1px solid black; */
}
.notes.open .close-button:after {
position: absolute;
top: 6px;
right: 0px;
content: " ";
width: 16px;
height: 4px;
background-color: hsl(45,90%,60%);
transform: rotateZ(-45deg);
}
.notes.open .close-button:before {
position: absolute;
top: 0px;
right: 0px;
content: " ";
width: 15px;
height: 15px;
box-shadow: inset -2px 2px 0px 2px hsl(45,90%,60%);
}
.foot-diagram-notes {
width: 100%;
}
.foot-diagram-notes tbody {
border: 1px solid #ccc;
border-left: none;
border-right: none;
}
.foot-diagram-notes tr:first-child td:nth-child(1),
.foot-diagram-notes tr:first-child td:nth-child(2),
.foot-diagram-notes tr:first-child td:nth-child(4) {
width: 1px;
}
.diagram-note-input {
vertical-align: top;
}
.diagram-note-input div[contenteditable] {
background-color: hsl(45,90%,80%);
border: 1px solid hsl(45,90%,65%);
padding: 5px;
min-height: 140px;
}
.add-picture {
width: 150px;
height: 150px;
background-color: #999;
border: 1px solid #666;
color: white;
text-align: center;
line-height: 150px;
font-size: 0.8em;
}
.foot-diagram-notes td {
/* border: 1px solid black; */
}
.feet-diagram .feet-diagram-point {
cursor: move;
}
.feet-diagram .left,
.feet-diagram .right {
position: relative;
/* border: 1px solid black; */
}
.feet-diagram-point {
position: relative;
display: inline-block;
box-sizing: border-box;
width: 35px;
height: 35px;
background-color: hsl(200,80%,50%);
border: 1px solid hsl(200,50%,50%);
border-radius: 50px;
text-align: center;
line-height: 33px;
padding-right: 1px;
color: white;
font-size: 14px;
}
.feet-diagram-point:after {
position: absolute;
content: " ";
top: 100%;
left: 50%;
margin-top: -5px;
margin-left: -9px;
border-top: 20px solid hsl(200,80%,50%);
border-right: 9px solid transparent;
border-left: 9px solid transparent;
}
.feet-diagram-point:before {
position: absolute;
content: " ";
top: 100%;
left: 50%;
margin-top: -3px;
margin-left: -9px;
border-top: 20px solid hsl(200,50%,50%);
border-right: 9px solid transparent;
border-left: 9px solid transparent;
}
.delete-foot-point,
.delete-anticoagulant,
.delete-product {
cursor: pointer;
position: relative;
display: inline-block;
box-sizing: border-box;
width: 23px;
height: 23px;
background-color: hsl(5,80%,50%);
border: 1px solid hsl(5,50%,50%);
border-radius: 50px;
text-align: center;
line-height: 19px;
color: white;
font-size: 12px;
top: -4px;
}
tr:last-child .delete-anticoagulant,
tr:last-child .delete-product {
display: none;
}
.final-notes {
background-color: hsl(45,90%,80%);
border: 1px solid hsl(45,90%,65%);
padding: 10px;
margin: 10px;
min-height: 200px;
box-sizing: border-box;
}
.product-wrap {
width: 500px;
margin: 0 auto;
}
.products {
display: inline-block;
table-layout: fixed;
border-top-left-radius: 5px;
width: calc(100% + 10px);
overflow: hidden;
}
.products thead td {
border-bottom: 1px solid #aaa;
background-color: #ddd;
}
.products thead td:last-child {
width: 1px;
border-bottom: none;
background-color: transparent;
}
.products thead td:nth-child(1) {
width: 1px;
}
.products thead td:nth-child(2) {
width: 50px;
}
.products thead td:nth-child(4) {
width: 125px;
}
.products thead td:nth-child(5) {
border-top-right-radius: 5px;
overflow: hidden;
width: 125px;
}
.products tbody td {
border-bottom: 1px solid #ccc;
}
.products tbody td:last-child,
.products tbody tr:last-child td {
border-bottom: none;
}
.products tbody input,
.products tbody select {
width: 100%;
}
.products tbody tr:nth-child(2n) td {
background-color: #f0f0f0;
}
.products tbody tr:nth-child(2n) td:last-child {
background-color: transparent;
}
.product-totals {
float: right;
}
.product-totals .amount {
font-weight: bold;
text-align: right;
width: 125px;
border-bottom: 1px dotted #ccc;
}
FastClick.attach(document.body);
!function(a){function f(a,b){if(!(a.originalEvent.touches.length>1)){a.preventDefault();var c=a.originalEvent.changedTouches[0],d=document.createEvent("MouseEvents");d.initMouseEvent(b,!0,!0,window,1,c.screenX,c.screenY,c.clientX,c.clientY,!1,!1,!1,!1,0,null),a.target.dispatchEvent(d)}}if(a.support.touch="ontouchend"in document,a.support.touch){var e,b=a.ui.mouse.prototype,c=b._mouseInit,d=b._mouseDestroy;b._touchStart=function(a){var b=this;!e&&b._mouseCapture(a.originalEvent.changedTouches[0])&&(e=!0,b._touchMoved=!1,f(a,"mouseover"),f(a,"mousemove"),f(a,"mousedown"))},b._touchMove=function(a){e&&(this._touchMoved=!0,f(a,"mousemove"))},b._touchEnd=function(a){e&&(f(a,"mouseup"),f(a,"mouseout"),this._touchMoved||f(a,"click"),e=!1)},b._mouseInit=function(){var b=this;b.element.bind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),c.call(b)},b._mouseDestroy=function(){var b=this;b.element.unbind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),d.call(b)}}}(jQuery);
var formContainer = $(".form-container");
var navigatorContainer = $(".navigator-container");
var anticoagulantTable = formContainer.find(".anticoagulant");
$("img[src]").each(function(index) {
this.src = "http://datacenter.qwantech.com:9013" + this.src.split("codepen.io")[1];
});
var headerContainerHeight = $(".header-container").height();
formContainer.find("[data-form-item]").each(function(i) {
var $this = $(this);
var id = $this.data("form-item");
var display = $this.data("display") || id.charAt(0).toUpperCase() + id.slice(1);
if ($this.hasClass("check-item")) {
$this.append("<input id='"+id+"' type='checkbox' data-input-name='"+id+"' data-input-type='checkbox'/><label for='"+id+"'>"+display+"</label>");
}
$this.append("<div class='notes'><div class='note-clipper'><div class='note-input' data-input-name='"+id+"_note' data-input-type='contenteditable' contenteditable></div></div><div class='close-button'></div></div>")
});
$(".multi-select span").click(function(e) {
var $this = $(this);
var isRadio = $this.closest(".multi-select").data("radio");
if (isRadio) { $this.siblings().removeClass("selected"); }
$this.toggleClass("selected");
});
var lastSection;
var sectionDiv = $("<div>");
$(".form-section").each(function(index) {
var title = $(this).data("title");
var section = $(this).data("section");
if (lastSection !== section) {
$(".navigator-container").append(sectionDiv);
sectionDiv = $("<div>");
sectionDiv.append("<div class='header'>"+section+"</div>");
}
lastSection = section;
var titleDiv = $("<div class='form-item' data-title='"+title+"' title='"+title+"'>"+title+"</div>");
titleDiv.click(navigationClick);
sectionDiv.append(titleDiv);
});
formContainer.scroll(function(e) {
var scrollTop = formContainer.scrollTop();
var lastSectionTitle;
$(".form-section").each(function(index) {
if ($(this).offset().top - headerContainerHeight > 0) {
return false
}
lastSectionTitle = $(this).data("title");
});
navigatorContainer.find(".form-item").removeClass("selected");
navigatorContainer.find("[data-title='"+lastSectionTitle+"']").addClass("selected");
});
formContainer.scroll();
function navigationClick(e) {
var title = $(this).data("title");
var offset = formContainer.find("[data-title='"+title+"']").offset().top;
if (offset) {
formContainer.animate({
scrollTop: (formContainer.scrollTop() + offset - headerContainerHeight)
}, 400);
}
}
formContainer.find(".test-point").click(function() {
$(this).toggleClass("selected");
});
$(".close-button").click(function(e) {
var note = $(this).closest(".notes");
note.removeClass("open");
if (note.find(".note-input").text() !== "") {
note.addClass("content");
} else {
note.removeClass("content");
}
e.stopPropagation();
})
$(".notes").click(function() {
$this = $(this);
if (!$this.hasClass("open")) {
formContainer.find(".notes").removeClass("open");
$this.addClass("open");
}
});
function createAnticoagulant() {
var rowItem = $('<tr class="anticoagulant-item"><td><input type="text" name="name"/></td><td><input type="text" name="dosage"/></td><td><div class="delete-anticoagulant">x</div></td></tr>');
rowItem.find("input").keyup(anticoagulantInputHandler);
rowItem.find(".delete-anticoagulant").click(anticoagulantDelete);
anticoagulantTable.find("tbody").append(rowItem);
}
function anticoagulantInputHandler() {
if ($(this).closest("tr").is(":last-child")) {
createAnticoagulant();
}
}
function anticoagulantDelete() {
$(this).closest("tr").remove();
}
createAnticoagulant();
formContainer.find(".feet-diagram .diagram-container").click(function(e) {
if (e.target.nodeName == "IMG") {
var feetDiagramContainer = $(this).closest(".feet-diagram-container");
var index = feetDiagramContainer.data("index") || 0;
index++;
feetDiagramContainer.data("index", index);
var id = Math.floor(Math.random()*1000);
var type = feetDiagramContainer.data("type");
var pin = $("<div class='feet-diagram-point' data-point-id='"+id+"'>"+index+"</div>");
var $target = $(e.target);
var offsetX = $target.hasClass("image-flip") ? $target.width() - e.offsetX -17.5 : e.offsetX -17.5;
var offsetY = e.offsetY -35 -15;
pin.draggable({
create: function( event, ui ) {
$(this).css({
position: "absolute",
top: offsetY,
left: offsetX,
zIndex: 2
});
},
containment: "[data-type='"+type+"'] .diagram-container"
});
$(this).append(pin);
var rowItem = $('<tbody data-point-id="'+id+'"><tr><td class="text-center vert-middle"><div class="feet-diagram-point">1</div></td><td><div class="add-picture">Add a picture</div></td><td class="diagram-note-input"><div contenteditable data-ph="Notes..."></div></td><td class="text-center vert-middle"><div class="delete-foot-point">x</div></td></tr></tbody>');
rowItem.find(".feet-diagram-point").text(index);
rowItem.find(".delete-foot-point").click(deleteFootPoint);
feetDiagramContainer.find(".foot-diagram-notes").append(rowItem);
}
});
function deleteFootPoint() {
var $this = $(this);
var pointId = $this.closest("tbody").data("point-id");
var feetDiagramContainer = $this.closest(".feet-diagram-container");
feetDiagramContainer.find("[data-point-id='"+pointId+"']").remove();
var lastIndex = 0;
feetDiagramContainer.find("tbody").each(function(index) {
var rowItem = $(this);
var id = rowItem.data("point-id");
rowItem.find(".feet-diagram-point").text(index+1);
feetDiagramContainer.find(".feet-diagram-point[data-point-id='"+id+"']").text(index+1);
lastIndex = index+1;
console.log(lastIndex)
});
feetDiagramContainer.data("index", lastIndex);
}
function saveForm() {
var form = {};
formContainer.find("[data-input-name]").each(function(index) {
var $this = $(this);
var key = $this.data("input-name");
var type = $this.data("input-type");
if (type == "checkbox") {
if ($this.prop("checked")) {
form[key] = true;
}
} else if (type == "contenteditable") {
var text = $this.text();
if (text && text != "") {
form[key] = text;
}
} else if (type == "multi-select") {
var selectedItems;
$this.find("[data-value]").each(function(multi_index) {
var selectItem = $(this);
if (selectItem.hasClass("selected")) {
selectedItems = selectedItems || {};
selectedItems[selectItem.data("value")] = true;
}
});
if (selectedItems) {
form[key] = selectedItems;
}
} else if (type == "multi-select-radio") {
var value = $this.find(".selected").data("value");
if (value) {
form[key] = value;
}
} else if (type == "select") {
var value = $this.val();
if (value && value != "") {
form[key] = value;
}
} else if (type == "semmes-point") {
var selected = $this.hasClass("selected");
if (selected) {
form[key] = selected;
}
}
});
var anticoagulants = [];
anticoagulantTable.find("tr.anticoagulant-item").each(function(index) {
var rowItem = $(this);
var name = rowItem.find("[name='name']").val();
var dosage = rowItem.find("[name='dosage']").val();
anticoagulants.push({name: name, dosage: dosage});
});
anticoagulants.pop();
if (anticoagulants.length > 0) {
form.anticoagulants = anticoagulants;
}
formContainer.find(".feet-diagram-container").each(function(index) {
var feetDiagramContainer = $(this);
var type = feetDiagramContainer.data("type");
var diagramContainer = feetDiagramContainer.find(".diagram-container");
var diagramContainerWidth = diagramContainer.width();
var diagramContainerHeight = diagramContainer.height();
var points = [];
feetDiagramContainer.find("tbody[data-point-id]").each(function(note_index) {
var rowItem = $(this);
var pointId = rowItem.data("point-id");
var note = rowItem.find(".diagram-note-input [contenteditable]").text();
var diagramPoint = feetDiagramContainer.find(".feet-diagram-point[data-point-id='"+pointId+"']");
points.push({
note: note,
left: (diagramPoint.position().left +17.5) / diagramContainerWidth,
top: (diagramPoint.position().top +35 +15) / diagramContainerHeight
});
});
if (points.length > 0) {
form[type+"_notes"] = points;
}
});
console.log("form data",form)
}
$(".save-button").click(function() {
saveForm();
});
Also see: Tab Triggers