SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    May 2008
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    HI, help pls.. simple question..

    i created a page and i dont have a plan making it online, its like a simple notes maker loaded in IE. the thing is i want to automate things, like save all the info that i typed in inside the form/textarea and save it in microsoft notepad. is it possible w/o having to have a server or sumthing like that... any help would be appreciated much...

    so far heres my code:

    Code:
    <html>
    <head><title>Toji's Improved Notes</title>
    <STYLE type="text/css">
    body {background-color: 000000}
    
    
    input    {
          font-family:Verdana, sans-serif;
          font-size:9px;
          font-style: normal;
          line-height: normal;
          color: #333333;
           }
    
    p      {
        font-family:Verdana, sans-serif;
        font-size:10px;
        font-style: normal;
        line-height: normal;
        color: CC9933;
        }
    
    input.time     {
              font-family:Verdana, sans-serif;
            }
    
    td.time         {
              font-family:Verdana, sans-serif;
              font-weight: bold;
              font-size:15px;
    
    
              background-color: 004000;
              color: red;
            }
    
    </STYLE>
    
    <style type="text/css">
             .default{
                width: 290px;
                padding: 3px;
                text-align:left;
                font:bold 10pt sans-serif;
                background-color:F2F2F2;
                font-size:11px;
                border:1px solid #000000;
             }
             .calcAvgInput{
                float:right;
                background-color:#FFFFFF;
                border:1px solid #7F9DB9;
                font:normal 10pt sans-serif;
             }
          </style>
    
    
    
    
    <script type="text/javascript">
    
    
    function StopWatch (showTime) {
      this.id = StopWatch.watches.length;
      StopWatch.watches[this.id] = this;
      this.showTime = typeof showTime == 'function' ? showTime : function
    () {};
      this.reset();
    }
    StopWatch.prototype.reset = function () {
      this.time = 0;
      this.components = {};
      this.computeComponents();
      this.showTime(this.components);
    }
    StopWatch.prototype.start = function () {
      this.tid = setTimeout('StopWatch.watches[' + this.id + '].run()',
    1000);
    }
    StopWatch.prototype.stop = function () {
      clearTimeout(this.tid);
    }
    StopWatch.prototype.run = function () {
      this.tid = setTimeout('StopWatch.watches[' + this.id + '].run()',
    1000);
      this.time++;
      this.computeComponents();
      this.showTime(this.components);
    }
    StopWatch.prototype.computeComponents = function () {
      var hours = Math.floor(this.time / StopWatch.secondsPerHour);
      var remainingTime = this.time - hours * StopWatch.secondsPerHour;
      var minutes = Math.floor(remainingTime / StopWatch.secondsPerMinute);
      var seconds = remainingTime - minutes * StopWatch.secondsPerMinute;
      var formattedTime = '';
      formattedTime += hours + ':';
      formattedTime += minutes < 10 ? '0' + minutes + ':' : minutes + ':';
      formattedTime += seconds < 10 ? '0' + seconds : seconds;
      this.components.time = this.time;
      this.components.hours = hours;
      this.components.minutes = minutes;
      this.components.seconds = seconds;
      this.components.formattedTime = formattedTime;
    }
    StopWatch.secondsPerMinute = 60;
    StopWatch.secondsPerHour = StopWatch.secondsPerMinute * 60;
    StopWatch.watches = new Array();
    </script>
    
    <script type="text/javascript">
    var stopWatch2;
    function showTimeTableWatch (components) {
      if (document.all)
        document.all.timeCell.innerText = components.formattedTime;
      else if (document.getElementById)
        document.getElementById('timeCell').firstChild.nodeValue =
    components.formattedTime;
    }
    </script>
    
    
    <script type="text/javascript">
    stopWatch = new StopWatch(showTimeFormWatch);
    </script>
    
    <script language= VBscript>
    
    sub mnuNextCall_OnClick
    with Menu
      .txtCallCntr.Value = Int(.txtCallCntr.Value) + 1
    end with
    end sub
    
    </script>
    
    <!--this script got from www.javascriptfreecode.com-Coded by: Krishna Eydatoula -->
    <body>
    
    <script LANGUAGE="JavaScript1.2">
    <!--
    
    
    //set Interval between each firework display, 
    var intervals=2000
    var sparksOn     = true;
    var speed        = 25;
    var power        = 1;
    
    //Dont change these values-------
    var documentWidth=documentHeight=randomx=randomy=leftcorner=topcorner=0
    var ns=(document.layers);
    var ie=(document.all);
    var sparksAflyin = false;
    var allDivs      = new Array(10);
    var totalSparks  = 0;
    //-------------------------------
    
    function initAll(){
    	if(!ns && !ie){
    	sparksOn = false;
    	return;
    	}
    setInterval("firework()",intervals)
    
    if (ns)
    	document.captureEvents(Event.MOUSEDOWN | Event.MOUSEMOVE);
    	for(dNum=0; dNum<7; ++dNum){
    		if(ie)
    			allDivs[dNum]=eval('document.all.sDiv'+dNum+'.style');
    		else
    			allDivs[dNum]=eval('document.layers["sDiv'+dNum+'"]');
    	}
    }
    
    function firework(){
    //below code detects the browser dimenions
    if (ie){
    documentWidth=document.body.clientWidth
    documentHeight=document.body.clientHeight
    leftcorner=document.body.scrollLeft
    topcorner=document.body.scrollTop
    }
    else if (ns){
    documentWidth=window.innerWidth
    documentHeight=window.innerHeight
    leftcorner=pageXOffset
    topcorner=pageYOffset
    
    }
    //below code randomly generates a set of coordinates that fall within the dimension
    randomx=leftcorner+Math.floor(Math.random()*documentWidth)
    randomy=topcorner+Math.floor(Math.random()*documentHeight)
    
    
    	if(sparksOn){
    		if(!sparksAflyin){
    			sparksAflyin=true;
    			totalSparks=0;
    			for(var spark=0;spark<=6;spark++){
    				dx=Math.round(Math.random()*50);
    				dy=Math.round(Math.random()*50);
    				moveTo(spark,randomx,randomy,dx,dy);
    			}
    		}
    	}
    }
    
    function moveTo(i,tempx,tempy,dx,dy){
    	if(ie){
    		if(tempy+80>(document.body.offsetHeight+document.body.scrollTop))
    			tempy=document.body.offsetHeight+document.body.scrollTop-80;
    		if(tempx+80>(document.body.offsetWidth+document.body.scrollLeft))
    			tempx=document.body.offsetWidth+document.body.scrollLeft-80;
    	}
    	if(tempx>-50&&tempy>-50){
    		tempx+=dx;tempy+=dy;	
    		allDivs[i].left=tempx;
    		allDivs[i].top=tempy;
    		dx-=power;dy-=power;
    		setTimeout("moveTo("+i+","+tempx+","+tempy+","+dx+","+dy+")",speed)
    	}
    	else
    		++totalSparks
    	if(totalSparks==7){
    		sparksAflyin=false;
    		totalSparks=0;
    	}
    }
    window.onload=initAll
    //End-->
    </script>
    <style>
    #sDiv0 {position:absolute; height:1; width:1; font-family:arial black; font-size:25px; color:Aqua;}
    #sDiv1 {position:absolute; height:1; width:1; font-family:arial black; font-size:22px; color:red;}
    #sDiv2 {position:absolute; height:1; width:1; font-family:arial black; font-size:20px; color:blue;}
    #sDiv3 {position:absolute; height:1; width:1; font-family:arial black; font-size:15px; color:orange;}
    #sDiv4 {position:absolute; height:1; width:1; font-family:arial black; font-size:25px; color:yellow;}
    #sDiv5 {position:absolute; height:1; width:1; font-family:arial black; font-size:25px; color:lightgreen;}
    #sDiv6 {position:absolute; height:1; width:1; font-family:arial black; font-size:20px; color:silver;}
    </style>
    <p></p>
    <div id="sDiv0">
      *</div>
    <div id="sDiv1">
      *</div>
    <div id="sDiv2">
      *</div>
    <div id="sDiv3">
      *</div>
    <div id="sDiv4">
      *</div>
    <div id="sDiv5">
      *</div>
    <div id="sDiv6">
      *</div>
    
    </STYLE>
    
    
    </body>
    
    </html>
    
    
    
    
    
    </head>
    
    
    <body>
           <div align="left">
            <form name="notepad">
            <table width="100%" border="0" cellpadding="0" cellspacing="0" style="border-collapse:
    
    collapse">
    
                <tr>
                <td>
                <textarea name="commentbox" rows="14" cols="35" wrap="">
    issue: 
    tel: 
    caller: 
    account: 
    p.email: 
    os: 
    modem: 
    standby: no
    digital: no
    router: none
    
    t/s
    
    
                </textarea>
                </tr>
                </td>
     
    
    
            <tr>
            <td>
            <input type="reset" name="reset3" value="RESET" style="font-family: Verdana font-size: 9.0pt"
    
    >
            </td>
            </tr>
            </form>
    
     
                <form name="notepad2">
                <table width="100%" border="0" cellpadding="0" cellspacing="0" style="border-collapse:
    
    collapse">
     
                <tr>
                <td>
                    <textarea name="commentbox" rows="5" cols="35" wrap="">
    
                </textarea>
                </tr>
                     </td>
    
                <tr>
                <td>
                <input type="reset" name="reset4" value="RESET" style="font-family: Verdana font-size:
    
    9.0pt" >
                </td>
                </tr>
                </form>
    
    <tr>
    <td>
    
    
    <br>
    
    
    
    <table width="100%" border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse">
    <td>
    <tr>
      <div class="default" style="background-color:#D9EDDD;">
        <b>Daily Average Handle Time </b>
          <div class="default">
             <input type="text" name="value" id="valueID" value="" class="calcAvgInput" size='5'
    
    'highlight' /> Last Call :
          </div>
          <div class="default">
             <input type="text" name="divisor" id="divisorID" value="0" class="calcAvgInput"
    
    style="background-color:#D9EDDD;font:bold 10pt sans-serif;" size='1' maxlength='2' readonly />
    
    Number's of call :
          </div>
          <div class="default">
             <input type="text" name="total" id="totalID" value="0" class="calcAvgInput"
    
    style="background-color:#D9EDDD;font:bold 10pt sans-serif;" size='6' maxlength='2' readonly /> Total
    
    Handle Time :
          </div>
          <div class="default">
             <input type="text" name="average" id="averageID" value="0" class="calcAvgInput"
    
    style="background-color:#D9EDDD;font:bold 10pt sans-serif;" maxlength='2' readonly /> AHT :
          </div>
        <div class="default">
             <input type="button" value="Calculate Average" class="calcAvgInput" onclick="calcAverage();"
    
    />
          </div>
    <script type="text/javascript">
             function calcAverage(){
                if(isNaN(parseFloat(objAmount.value))){
                   alert("Enter only numbers and try again.");
                } else {
                   objDivisor.value = parseFloat(objDivisor.value) + 1;
                   objTotal.value = parseFloat(objTotal.value) + parseFloat(objAmount.value);
                   objAverage.value = (objTotal.value / objDivisor.value);
                }
             }
         
             var objTotal = document.getElementById("totalID");
             var objAmount = document.getElementById("valueID");
             var objAverage = document.getElementById("averageID");
             var objDivisor = document.getElementById("divisorID");
          </script>
    
    </div>
    
    </td>
    </tr>
    </table>
    
    <br>
    <table border="0" >
    <tr>
    <td id="timeCell" class="time" align="center"
    valign="middle"> </td>
    </tr>
    
    <tr>
    <td color="white">
    <input type="button"
           value="start"
           onclick="stopWatch2.start();"
    />
    <input type="button"
           value="stop"
           onclick="stopWatch2.stop();"
    />
    <input type="button"
           value="reset"
           onclick="stopWatch2.reset();"
    />
    
    <form name="menu">
    
    <input type='button' name='mnuNextcall' value='Start Next Call' style='font-family: verdana; font-
    
    size: 10px;'>
    
    
    
    <div align='left' font-family: verdana; background-color : F2F2F2; font-size: 11px; border:1px solid
    
    black;><font face="Verdana" size="1" color="RED">Calls Handled : </font><input type='text'
    
    name='txtCallCntr' value='0' size='1' maxlength='2' readonly></div>
    </div>
    
    </form>
    
    </td>
    </tr>
    </table>
    
    
    <script type="text/javascript">
    stopWatch2 = new StopWatch(showTimeTableWatch);
    </script>
    
    
     
    </table>
    </p>
    </table>
    </body>
    </html>

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,705
    Mentioned
    101 Post(s)
    Tagged
    4 Thread(s)
    No, that's not possible with javascript.
    It might be possible with activex though.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •