global: 'Dream Multimedia' -> 'Dream Property'
[enigma2-plugins.git] / webinterface / src / m / timeredit.html.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <e2:screen name="TimerEditWebScreen">&lt;!DOCTYPE html><html>
3 <head>
4         <title>Edit Timer</title>
5         <meta http-equiv="Content-Type" content="text/xhtml; charset=utf-8" />
6         <meta name="viewport" content="width=device-width, initial-scale=1" />
7
8         <link rel="shortcut icon" type="image/x-icon" href="/web-data/img/favicon.ico" />
9         <link type="text/css" rel="stylesheet" href="/web-data/m/css/themes/dream.min.css" />
10         <link type="text/css" rel="stylesheet" href="/web-data/m/css/jquery.mobile.structure-1.1.1.min.css" />
11         <link type="text/css" rel="stylesheet" href="/web-data/m/css/mobiscroll-2.0.1.custom.min.css" />
12
13         <script src="/web-data/lib/jquery-1.7.1.min.js" />
14         <script language="javascript" type="text/javascript">
15                 $(document).bind("mobileinit", function(){
16                         $.extend(  $.mobile , {
17                                 defaultPageTransition: 'none',
18                                 defaultDialogTransition: 'none'
19                         });
20                 });
21         </script>
22         <script src="/web-data/m/script/jquery.mobile-1.1.1.min.js" />
23         <script src="/web-data/m/script/mobiscroll-2.0.1.custom.min.js" />
24 </head>
25 <body>
26
27 <div data-role="page" id="timeredit" data-title="Edit Timer" data-theme="a">
28         <div data-role="header">
29                 <h1>Edit Timer</h1>
30                 <a href="/m/" data-icon="home" data-iconpos="notext" data-direction="reverse" class="ui-btn-left jqm-home" data-ajax="false">Home</a>
31         </div><!-- /header -->
32         <div data-role="content">
33                 <form id="timerform" action="timersave.html" method="get" data-inset="true" data-ajax="true">
34                         <div data-role="fieldcontain">
35                                 <fieldset data-role="controlgroup" data-type="horizontal" data-mini="true" id="fs-disabled">
36                                         <label for="action-enabled">Enabled</label>
37                                         <input type="radio" name="disabled" id="action-enabled" value="0" checked="checked"/>
38
39                                         <label for="action-disabled">Disabled</label>
40                                         <input type="radio" name="disabled" id="action-disabled" value="1"/>
41                                 </fieldset>
42                         </div>
43                         <div data-role="fieldcontain">
44                                 <label for="name">Name:</label>
45                                 <input type="text" name="name" id="name" placeholder="Name"/>
46                         </div>
47                         <div data-role="fieldcontain">
48                                 <label for="description">Description:</label>
49                                 <input type="text" name="description" id="description" placeholder="Description"/>
50                         </div>
51                         <div data-role="fieldcontain">
52                                 <label for="begin">Begin</label>
53                                 <input placeholder="Begin date and time" name="begin" id="begin" type="text"/>
54                         </div>
55                         <div data-role="fieldcontain">
56                                 <label for="end">End</label>
57                                 <input placeholder="End date and time" name="end" id="end" type="text"/>
58                         </div>
59                         <div data-role="fieldcontain">
60                                 <label for="bRef">Bouquet:</label>
61                                 <select id="bRef" name="bRef">
62                                         <e2:element source="BouquetList"><e2:convert type="web:ListFiller" >
63                                         &lt;option value="<e2:item name="Reference" filter="attribute"/>">
64                                                 <e2:item name="Name" filter="html"/>
65                                         &lt;/option>
66                                         </e2:convert><e2:convert type="web:TextToHTML" /></e2:element>
67                                 </select>
68                                 <label for="sRef">Service:</label>
69                                 <select id="sRef" name="sRef">
70                                         <e2:element source="ServiceList" id="bRef"><e2:convert type="web:ListFiller" >
71                                         &lt;option value="<e2:item name="Reference" filter="attribute"/>">
72                                                 <e2:item name="Name" filter="html"/>
73                                         &lt;/option>
74                                         </e2:convert><e2:convert type="web:TextToHTML" /></e2:element>
75                                 </select>
76                         </div>
77                         <div data-role="fieldcontain">
78                                 <label for="location">Location:</label>
79                                 <select id="location" name="location">
80                                         <e2:element source="Locations"><e2:convert type="web:SimpleListFiller">
81                                                 &lt;option><e2:item name="" filter="xml" />&lt;/option>
82                                                 </e2:convert><e2:convert type="web:TextToHTML" />       
83                                         </e2:element>
84                                 </select>
85                         </div>
86                         <div data-role="fieldcontain">
87                                 <label for="tags">Tags:</label>
88                                 <fieldset data-role="controlgroup" data-type="horizontal" data-mini="true" id="tags">
89                                         <e2:element source="Tags"><e2:convert type="web:SimpleListFiller">
90                                                         &lt;label for="tag-<e2:item name="" filter="xml" />"><e2:item name="" filter="xml" />&lt;/label>
91                                                         &lt;input class="tags" id="tag-<e2:item name="" filter="xml" />" type="checkbox" value="<e2:item name="" filter="xml" />">&lt;/input>
92                                         </e2:convert><e2:convert type="web:TextToHTML" />
93                                         </e2:element>
94                                 </fieldset>
95                         </div>
96                         <div data-role="fieldcontain">
97                                 <label for="afterevent">Afterevent:</label>
98                                 <select id="afterevent" name="afterevent">
99                                                 <option value="0">Nothing</option>
100                                                 <option value="1">Standby</option>
101                                                 <option value="2">Deepstandby</option>
102                                                 <option value="3">Auto</option>
103                                 </select>
104                         </div>
105                         <div data-role="fieldcontain">
106                                 <fieldset data-role="controlgroup" data-type="horizontal" data-mini="true" id="action">
107                                         <label for="action-record">Record</label>
108                                         <input type="radio" name="justplay" id="action-record" value="0" checked="checked"></input>
109
110                                         <label for="action-zap">Zap</label>
111                                         <input type="radio" name="justplay" id="action-zap" value="1" ></input>
112                                 </fieldset>
113                         </div>
114                         <fieldset>
115                                 <button type="submit" name="save" value="1" data-inline="true">Save</button>
116                                 <button type="cancel" name="cancel" value="0" data-inline="true">Cancel</button>
117                         </fieldset>
118                         <input type="hidden" id="eit" name="eit" value="0"></input>
119                 </form>
120         </div>
121         <div data-role="footer">
122                 <h1> 2012 Dream Property GmbH</h1>
123         </div><!-- /footer -->
124 </div>
125 <script>
126         $(document).ready(
127                 function(){
128                         $.scroller.themes.jqm.defaults = {
129                                 jqmBody:"a",
130                                 jqmHeader:"a",
131                                 jqmWheel:"a",
132                                 jqmClickPick:"d",
133                                 jqmSet:"d",
134                                 jqmCancel:"a"
135                         };
136                         // scroller defaults
137                         var now = new Date();
138                         $.scroller.setDefaults({
139                                 preset: 'datetime',
140                                 minDate: new Date(now.getFullYear(), now.getMonth(), now.getDate()),
141                                 maxDate: new Date(now.getFullYear()+10, now.getMonth(), now.getDate()),
142                                 dateFormat: 'yy-mm-dd',
143                                 dateOrder: 'yymmdd',
144                                 timeFormat: 'HH:ii',
145                                 timeWheels: 'HH:ii',
146                                 theme: 'jqm',
147                                 display: 'modal',
148                                 mode: 'mixed'
149                         });
150                         $('#begin').scroller();
151                         $('#end').scroller();
152
153                         //set the default values pass via url-parameters
154                         var bouquet = $('#bRef');
155                         var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&amp;');
156                         var beginDate = null;
157                         var endDate = null;
158                         for(var i = 0; i &lt; hashes.length; i++){
159                                 hash = hashes[i].split('=');
160
161                                 var key = hash[0];
162                                 var value = hash[1];
163                                 var elem = $('#' + key);
164                                 if(elem){
165                                         switch(key){
166                                         case "begin":
167                                                 $('#begin').scroller(
168                                                         'setDate',
169                                                         $.scroller.parseDate("yy-mm-ddHH:ii", value),
170                                                         true
171                                                 );
172                                                 break;
173                                         case "end":
174                                                 $('#end').scroller(
175                                                         'setDate',
176                                                         $.scroller.parseDate("yy-mm-ddHH:ii", value),
177                                                         true
178                                                 );
179                                                 break;
180                                         case "justplay":
181                                                 if(value == "1"){
182                                                         $("#action-record").attr("checked",false).checkboxradio("refresh");
183                                                         $("#action-zap").attr("checked",true).checkboxradio("refresh");
184                                                 } else {
185                                                         $("#action-zap").attr("checked",false).checkboxradio("refresh");
186                                                         $("#action-record").attr("checked",true).checkboxradio("refresh");
187                                                 }
188                                                 break;
189                                         case "disabled":
190                                                 if(value == "1"){
191                                                         $("#action-enabled").attr("checked",false).checkboxradio("refresh");
192                                                         $("#action-disabled").attr("checked",true).checkboxradio("refresh");
193                                                 } else {
194                                                         $("#action-disabled").attr("checked",false).checkboxradio("refresh");
195                                                         $("#action-enabled").attr("checked",true).checkboxradio("refresh");
196                                                 }
197                                                 break;
198                                         case "tags":
199                                                 var tags = decodeURIComponent(value).split(" ");
200                                                 $.each(tags, function(index, value){
201                                                         var elem = $("#tag-" + value);
202                                                         if(elem.length > 0){
203                                                                 elem.attr("checked", true).checkboxradio("refresh");
204                                                         } else {
205                                                                 console.log("Unknown Tag: " + value);
206                                                         /*
207                                                                 $('#tags').append(
208                                                                         $(document.createElement("input")).attr({
209                                                                                 type: "checkbox",
210                                                                                 id: "tag-" + value,
211                                                                                 name: value,
212                                                                                 value: value,
213                                                                                 checked: true
214                                                                         })
215                                                                 ).trigger('create');
216                                                                 $('#tags').append(
217                                                                         $(document.createElement("label")).attr({
218                                                                                 for: "tag-" + value,
219                                                                         }).html(value)
220                                                                 ).trigger('create');;
221                                                         */
222                                                         }
223                                                 });
224
225                                                 break;
226                                         default:
227                                                 value = decodeURIComponent(value);
228                                                 elem.val(value);
229                                         }
230                                 }
231                         }
232                         $('#afterevent').selectmenu('refresh', true);
233                         $('#location').selectmenu('refresh', true)
234                         $('#sRef').selectmenu('refresh', true);
235
236                         //reload on bouquet change
237                         bouquet.change(function(){
238                                 var serviceList = $('#sRef')
239                                 var bouquet = encodeURIComponent( $("#bRef").val() );
240                                 var current = $("#sRef").val();
241                                 serviceList.load("/m/timerservices.html?bRef=" + bouquet, function(){
242                                         serviceList.val(0).selectmenu('refresh', true);
243                                 });
244                         });
245                 }
246         );
247
248 </script>
249 </body>
250 </html>
251 </e2:screen>