/[projects]/misc/horsensspejder-web/nybesked.php
ViewVC logotype

Diff of /misc/horsensspejder-web/nybesked.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2139 by torben, Wed Mar 12 19:30:05 2014 UTC revision 2140 by torben, Tue Apr 8 06:41:10 2014 UTC
# Line 6  require("inc/config.php"); Line 6  require("inc/config.php");
6    
7  <script type="text/javascript">  <script type="text/javascript">
8    
9    String.prototype.endsWith = function(suffix) {
10        return this.indexOf(suffix, this.length - suffix.length) !== -1;
11    };
12    
13  function getSelectedString(selector, type) {  function getSelectedString(selector, type) {
14          var str = "";          var str = "";
15    
# Line 19  function getSelectedString(selector, typ Line 23  function getSelectedString(selector, typ
23          return encodeURIComponent( str );          return encodeURIComponent( str );
24  }  }
25    
26    var prevSmsString= "";
27    
28  var personCount = 0;  var personCount = 0;
29  var smscount = 0;  var smscount = 0;
30    
# Line 57  $(function() { Line 63  $(function() {
63          });*/          });*/
64          $("#enheder").chosen().change( function() {          $("#enheder").chosen().change( function() {
65                  updateCount();                  updateCount();
66                    $("#sendmail").click();
67          });          });
68    
69          $("#individer").chosen().change( function() {          $("#individer").chosen().change( function() {
70                  updateCount();                  updateCount();
71                    $("#sendmail").click();
72          });          });
73            
74            
75    
76                    
77                    
# Line 89  $(function() { Line 99  $(function() {
99                  });                  });
100          });          });
101    
102          $("#besked").keyup( function(event) {          prevSmsString = $("#besked").val();
103            $("#besked").keyup ( function(event) {
104                  var msg = $(this).val();                  var msg = $(this).val();
105                  msg = $.trim(msg);                  msg = $.trim(msg);
106                    
107                    
108                    if (! msg.endsWith("www.HorsensSpejder.dk")) {
109                            $(this).val(prevSmsString);
110                            return;
111                    }
112                    
113                    // sms er godkendt - gem til senere brug
114                    prevSmsString = msg;//
115                    
116                  var count = msg.length                  var count = msg.length
117                  $("#antaltegn").html(msg.length );                  $("#antaltegn").html(msg.length );
118                                    
# Line 103  $(function() { Line 124  $(function() {
124                                                    
125                  }                  }
126                  $("#antalbesked").html(smscount );                        $("#antalbesked").html(smscount );      
127                    
128                    
129                    
130                  updateTotal();                  updateTotal();
131          });          });
132    
# Line 154  E-mail <input type="radio" name="msgtype Line 178  E-mail <input type="radio" name="msgtype
178  <div id="SMS">  <div id="SMS">
179  <br>  <br>
180  <i>Besked</i><br>  <i>Besked</i><br>
181  <textarea rows="5" cols="90" id="besked"></textarea><br>  <textarea rows="5" cols="90" id="besked">
182    
183    www.HorsensSpejder.dk
184    </textarea><br>
185  Antal tegn: <span id="antaltegn">0</span> / Antal SMS: <span id="antalbesked">0</span> / Total antal SMS: <span id="totalantal">0</span> / Samlet pris: <span id="samletpris">0.00</span>kr  Antal tegn: <span id="antaltegn">0</span> / Antal SMS: <span id="antalbesked">0</span> / Total antal SMS: <span id="totalantal">0</span> / Samlet pris: <span id="samletpris">0.00</span>kr
186    
187  <br>  <br>

Legend:
Removed from v.2139  
changed lines
  Added in v.2140

  ViewVC Help
Powered by ViewVC 1.1.20