Changeset 5901 for trunk/prototype/modules/calendar/js/helpers.js
- Timestamp:
- 04/09/12 17:55:40 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/prototype/modules/calendar/js/helpers.js
r5863 r5901 2161 2161 tabsImportExport.find('option[value="'+calendarId+'"]').attr('selected','selected').trigger('change'); 2162 2162 2163 2163 var form = false; 2164 $('.import-event-form').fileupload({ 2165 sequentialUploads: true, 2166 add: function (e, data) { 2167 form = data 2168 var name = form.files[0].name; 2169 $('.import-event-form').find('input[type="file"]').hide(); 2170 $('.import-event-form').find('span.file-add').removeClass('hidden'); 2171 $('.import-event-form').find('span.file-add').append('<span>'+ name +'</span><a class="button remove-attachment tiny"></a>'); 2172 $('.import-event-form').find('.button.remove-attachment').button({ 2173 icons: { 2174 primary: "ui-icon-close" 2175 }, 2176 text: false 2177 }).click(function (event){ 2178 $('.import-event-form').find('input[type="file"]').show(); 2179 $('.import-event-form').find('span.file-add').addClass('hidden').html(''); 2180 form = false; 2181 }); 2182 2183 2184 }, 2185 done: function(e, data){ 2186 var msg = ''; 2187 var type = ''; 2188 2189 if(!!data.result && data.result == "[][[]]"){ 2190 msg = 'Não foram encontrados novos eventos na importação!'; 2191 type = 'information'; 2192 }else if(!!data.result && data.result == '[][false]'){ 2193 msg = 'Erro ao realizar a importação, por favor verifique o arquivo .ics'; 2194 type = 'warning'; 2195 }else{ 2196 msg = 'Importação realizada com sucesso!'; 2197 type = 'confirmation'; 2198 Calendar.rerenderView(true); 2199 } 2200 2201 $.Zebra_Dialog(msg, { 2202 'type': type, 2203 'overlay_opacity': '0.5', 2204 'buttons': ['Fechar'] 2205 }); 2206 } 2207 }); 2208 2164 2209 UI.dialogs.importCalendar.find(".menu-import-event") 2165 2210 .children(".import").click(function(data){ … … 2168 2213 Calendar.signatureOf[$('.import-event-form option:selected').val()].calendar.timezone 2169 2214 +'"/>') 2170 2171 $('.import-event-form', UI.dialogs.importCalendar).submit();2215 if(form) 2216 form.submit(); 2172 2217 UI.dialogs.importCalendar.dialog("close"); 2173 isValidCalback = true;2174 2218 /** 2175 2219 * TODO - implementar ação de importação
Note: See TracChangeset
for help on using the changeset viewer.