aikinetix

example.js

Apr 9th, 2014
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var selectedtool;
  2.  
  3. //Toolstates
  4. var selectionTool, textTool, linkTool, divTool, tableTool, formTool = false;
  5.  
  6. $(function()
  7. {
  8.  
  9. });
  10.  
  11. function selectTool(tool)
  12. {
  13.     $(tool).switchClass('toolboxtool', 'toolboxtoolselected', 150);
  14.     if(tool != selectedtool)
  15.     {
  16.         $(selectedtool).switchClass('toolboxtoolselected', 'toolboxtool', 1);
  17.     }
  18.     if(tool == "#selectiontool")
  19.     {
  20.         document.getElementById("infobox").innerHTML =
  21.         "<div class='infoboxtitle' id='infoboxtitle'>Info</div><div class='infoboxgrip' id='infoboxgrip' title='Drag Me'>≡≡≡</div><div class='elementtitle' id='elementtitle'>Selection Tool</div>";
  22.         document.body.style.cursor = "copy";
  23.     }
  24.     if(tool == "#texttool"){document.body.style.cursor = "text";}
  25.     if(tool == "#linktool"){document.body.style.cursor = "text";}
  26.     if(tool == "#divtool"){document.body.style.cursor = "cell";}
  27.     if(tool == "#tabletool"){document.body.style.cursor = "default";}
  28.     if(tool == "#formtool"){document.body.style.cursor = "default";}
  29.     if(tool == "#sitesettings")
  30.     {
  31.         document.getElementById("infobox").innerHTML =
  32.         "<div class='infoboxtitle' id='infoboxtitle'>Info</div><div class='infoboxgrip' id='infoboxgrip' title='Drag Me'>≡≡≡</div><div class='elementtitle' id='elementtitle'>Background</div><div class='elementoption' id='elementoption'><input type='checkbox'id='backgroundcolorcheck'checked='checked'onclick='applyOptions()'></input>&nbsp;Background Color: #<input  type='text'class='textfield'id='backgroundcolor'maxlength='6'oninput='applyOptions()'></input><br /><div    class='elementexample'id='elementexample'onclick='$(" + '"#backgroundcolor"' + ").val(" + '"000000"' + ");applyOptions()'>Black</div><div   class='elementexample'id='elementexample'onclick='$(" + '"#backgroundcolor"' + ").val(" + '"CC0000"' + ");applyOptions()'>Red</div><div class='elementexample'id='elementexample'onclick='$(" + '"#backgroundcolor"' + ").val(" + '"00CC00"' + ");applyOptions()'>Green</div><div   class='elementexample'id='elementexample'onclick='$(" + '"#backgroundcolor"' + ").val(" + '"0000CC"' + ");applyOptions()'>Blue</div><br /></div><div class='elementoption' id='elementoption'><input    type='checkbox'id='backgroundimagecheck'checked='checked'onclick='applyOptions()'></input>&nbsp;Background Image: <input type='text'class='textfield'id='backgroundimage'placeholder='http://www.example.com'onchange='applyOptions()'></input><br /><div class='elementexample'id='elementexample'onclick='$(" + '"#backgroundimage"' + ").val(" + '"http://farm6.staticflickr.com/5093/5450854606_4ece968890_z.jpg"' + ");applyOptions()'>Example Background</div>Repeat:&nbsp;<input type='radio'name='backgroundimageradio'id='backgroundimageradiono'onclick='applyOptions()'>No&nbsp;</input><input   type='radio'name='backgroundimageradio'id='backgroundimageradiox'onclick='applyOptions()'>X&nbsp;</input><input type='radio'name='backgroundimageradio'id='backgroundimageradioy'onclick='applyOptions()'>Y&nbsp;</input><input type='radio'name='backgroundimageradio'id='backgroundimageradioboth'checked='checked'onclick='applyOptions()'>Both&nbsp;</input></div><br />";
  33.         document.body.style.cursor = "default";
  34.     }
  35.  
  36.     selectedtool = tool;
  37.     return;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment