script type text javascript src STATIC_URL js jquery simplemodal js ty

  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
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
<script type="text/javascript" src="<{$STATIC_URL}>js/jquery.simplemodal.js" type="text/javascript"></script>
<script type="text/javascript">
$j(document).ready(function(){
Invite.bindServices();
<{if $list || $error}>
Invite.open(false, false, true);
<{elseif $error}>
Invite.open();
<{/if}>
});
Invite = {
formId: 'invForm',
modalId: 'basicModalContent',
UPLOAD_TYPE_CSV: 'csv',
UPLOAD_TYPE_LDIF: 'ldif',
select: function(){
var boxes = $j('.invEmails :checked[name="emails[]"]');
if(!boxes.length){
alert('You have not selected any email');
return false;
}
var strReceivers = '';
for (var i=0; i<boxes.length; i++) {
strReceivers += boxes[i].value + ",\n";
}
this.addToTextarea(strReceivers);
this.close();
},
addToTextarea: function(txt){
var currTxt = $j('#receivers').val();
if(currTxt.length){
currTxt += ', ';
}
$j('#receivers').val(
currTxt + '' + txt
);
},
reset: function(){
$j('#receivers').val('');
},
open: function(logoClass, name, isAjax){
var logo = $j('#inviteLogo');
logo[0].className = '';
logo.addClass(logoClass);
$j('#modalTitle').html('<{$title}>');
$j('#modalDescription').html('<{$description}>');
if (!isAjax) {
$j('#loginForm').show();
$j('#list').html('');
}
$j('#basicModalContent').modal();
$j('#currService').html('' + name);
$j('.serviceName').val(name);
$j('#email').val('');
$j('#password').val('');
if (name == 'Outlook' || name == 'Thunderbird') {
$j('#fieldsForm').hide();
$j('#uploadFile').show();
if (name == 'Outlook') {
$j('#uploadType').val(this.UPLOAD_TYPE_CSV);
} else {
$j('#uploadType').val(this.UPLOAD_TYPE_LDIF);
}
} else {
$j('#uploadType').val('');
$j('#fieldsForm').show();
$j('#uploadFile').hide();
}
},
close: function(){
$j('#services').val(0);
$j('#importError').html('');
$j('.modalClose').trigger('click');
$j('#ozpanel_please_wait').hide();
this.clearError();
},
submit: function(){
$j('#loginForm').show();
$j('#list').hide().html('');
$j('#importError').html('');
var form = $j('#' + this.formId);
var url = form.attr('action');
var serviceName = $j('#currService').html();
$j('#ozpanel_please_wait').show();
if ($j('#uploadType').val() == '') {
$j.post(url, form.serialize() + '&serviceName=' + encodeURIComponent(serviceName),
function(data, textStatus){
$j('#ozpanel_please_wait').hide();
$j('#list').html(data);
if ($j('#list').find('.error').html() == null) {
$j('#list').show();
} else {
$j('#list').html('');
$j('#importError').html(data);
}
}
);
} else {
form.submit();
}
return false;
},
clearError: function(){
$j('.error').html('');
},
bindServices: function(){
var _self = this;
$j('#services').change(function(){
if(this.value != 0){
_self.open(this.value, this.options[this.selectedIndex].innerHTML);
}
});
}
};
</script>
<div id="inviteform" class="invitebox">
<form method="post" id="sendInviteForm" name="sendInviteForm" action="<{$HOME_URL}>invite/send">
<div class="wrap">
<dl class="invList">
<dt><label>Von:</label></dt>
<dd><{$memberName}></dd>
<dt><label>An:</label><span style="color:#777777;">(mehrere E-Mail Adressen durch Kommata trennen)</span></dt>
<dd><textarea name="receivers" id="receivers" rows="4" cols="6"></textarea></dd>
<dt><label>Einladungstext:</label><span style="color:#777777;">(optional)</span></dt>
<dd><textarea name="msg" id="msg" rows="4" cols="6"></textarea></dd>
<dt>&nbsp;</dt>
<dd style="width:100%;">
<span class="button" style="margin-left:5px;">
<input style="width:90px;" type="button" onclick="Invite.reset()" value="Abbrechen"/>
</span>
<span class="button">
<input style="width:90px;" type="submit" value="Einladen"/>
</span>
</dd>
</dl>
</div>
</form>
</div>
<div>
<{include file="invite/service_logos.tpl"}>
</div>
<{include file="invite/modal.tpl"}>