~robbyoconnor/sahana-eden/surveytool

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<!--Running in Production mode, so we want fewer compressed scripts to download-->

<script type="text/javascript">//<![CDATA[
// Global variable to store all of our variables inside
var S3 = Object();
{{if response.s3.rtl:}}
S3.rtl = true;
{{else:}}
S3.rtl = false;
{{pass}}
S3.gis = Object();
function s3_debug(message, value) {
        // no debug
    }
//]]></script>

{{if session.s3.cdn:}}
<!-- For Sites Hosted on the Public Internet, using Google's version of jQuery will provide better performance -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js" type="text/javascript"></script>
{{else:}}
<script src="/{{=request.application}}/static/scripts/web2py/jquery-1.4.2.min.js" type="text/javascript"></script>
{{pass}}
<script src="/{{=request.application}}/static/scripts/S3/jquery.validate.pack.js" type="text/javascript"></script>
<!--This script is created by /static/scripts/tools/build.sahana.py-->
<script src="/{{=request.application}}/static/scripts/S3/S3.min.js" type="text/javascript"></script>

<!--Scripts which need pre-processing by server must be called in-line-->

<!--Web2Py Layer-->
<script type="text/javascript">//<![CDATA[
jQuery(document).ready(function() {
    jQuery("input[type='checkbox'].delete").click(function() { if(this.checked) if(!confirm("{{=T('Sure you want to delete this object?')}}")) this.checked=false; });
    try { jQuery("input.datetime").focus( function() {Calendar.setup({
         inputField:this.id, ifFormat:"{{=T('%Y-%m-%d %H:%M:%S')}}", showsTime: true,timeFormat: "24"
    }); }); } catch(e) {};
});
//]]></script>

<!--T2 Layer-->
<script type="text/javascript">//<![CDATA[

{{include "l10n.js"}}

jQuery(document).ready(function(){
    try { jQuery('.zoom').fancyZoom({scaleImg:true, closeOnClick:true, directory:"/{{=request.application}}/static/media"}); } catch(e) {};
});
//]]></script>

<!--S3 Layer-->
<script type="text/javascript">//<![CDATA[
function s3_viewMap(feature_id) {
    var url = '{{=URL(r=request, c="gis", f="display_feature")}}/' + feature_id;
    var iframe = "<iframe width='640' height='480' src='" + url + "'></iframe>";
    $('#map').html(iframe);
}
function s3_viewMapMulti(module, resource, instance, jresource) {
    var url = '{{=URL(r=request, c="gis", f="display_features")}}/?module=' + module + '&resource=' + resource + '&instance=' + instance + '&jresource=' + jresource;
    var iframe = "<iframe width='640' height='480' src='" + url + "'></iframe>";
    $('#map').html(iframe);
}
jQuery(document).ready(function() {
    jQuery('input.date').datepicker({ changeMonth: true, changeYear: true, dateFormat: 'yy-mm-dd', isRTL: false });
    jQuery('a#delete-btn').click(function(event){ if(confirm("{{=T("Sure you want to delete this object?")}}")) {
            return true;
        } else {
            event.preventDefault();
            return false;
        }
    });
    jQuery('.tooltip').cluetip({activation: 'hover', sticky: false, splitTitle: '|'});
    jQuery('.stickytip').cluetip({activation: 'hover', sticky: true, closePosition: 'title', closeText: '<img src="/{{=request.application}}/static/img/cross2.png" alt="close" />', splitTitle: '|'});
    jQuery('.ajaxtip').cluetip({activation: 'click', sticky: true, closePosition: 'title', closeText: '<img src="/{{=request.application}}/static/img/cross2.png" alt="close" />', width: 380});
    now = new Date();
    jQuery('form').append("<input type='hidden' value=" + now.getTimezoneOffset() + " name='_utc_offset'/>");
});
//]]></script>

{{if session.s3.cdn:}}
<!-- For Sites Hosted on the Public Internet, using Cachefly CDN's version of ExtJS may provide better performance -->
<script type="text/javascript" src="http://extjs.cachefly.net/ext-3.2.1/adapter/jquery/ext-jquery-adapter.js"></script>
<script type="text/javascript" src="http://extjs.cachefly.net/ext-3.2.1/ext-all.js"></script>
{{else:}}
<script src="/{{=request.application}}/static/scripts/ext/adapter/jquery/ext-jquery-adapter.js" type="text/javascript"></script>
<script src="/{{=request.application}}/static/scripts/ext/ext-all.js" type="text/javascript"></script>
{{pass}}