Guest User

Untitled

a guest
Apr 21st, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $("#arquivo").uploadify({
  2.             'uploader'      : '/scripts/uploadify/uploadify.swf',
  3.             'script'        : '/nasparadas.upload',
  4.             'cancelImg'     : '/scripts/uploadify/cancel.png',
  5.             'width'         : '120',
  6.             'height'        : '30',
  7.             'wmode'         : 'transparent',
  8.             'fileDataName'  : 'imgNoticia',
  9.             'fileExt'       : '*.jpg',
  10.             'fileDesc'      : 'Imagens JPG',
  11.             'auto'          : true,
  12.             'multi'         : false,
  13.             'removeComplete': false,
  14.             'buttonText'    : 'Arquivo',
  15.             'onComplete'    : function (event, queueID, fileObj, response, data) {
  16.                 if (response != "") {
  17.                     //alert('Event: '+JSON.stringify(event)+'\nqueueId: '+JSON.stringify(queueID)+'\nfileObj: '+JSON.stringify(fileObj)+'\nResponse: '+JSON.stringify(response)+'\nData: '+JSON.stringify(data));
  18.                     $('#campo_arquivo div').html('<img src="/images/nasparadas/'+response+'_n.jpg?w=50&h=50&c=3&cor=000&data='+(new Date()).getTime()+'" alt="">');
  19.                     return true;
  20.                 }
  21.             },
  22.             'onError': function (event, queueID, fileObj, errorObj) {
  23.                 if (errorObj != "") {
  24.                     alert('Erro: '+errorObj.info);
  25.                     if (errorObj.info == 552) {
  26.                         alert('Você precisa entrar com sua conta para enviar uma foto.');
  27.                     } else if (errorObj.info == 553) {
  28.                         alert('Envie apenas arquivos .jpg');
  29.                     }
  30.                     $('#fuFotoPerfil').uploadifyClearQueue();
  31.                     return true;
  32.                 }
  33.             },
  34.             'onSelect': function (event, queueID, fileObj) {
  35.                 $('#arquivo').uploadifySettings('scriptData', { 'ASPSESSID': user.aspsessid, 'AUTH': user.auth, 'ID': $('#id').val(), 'Token': $('#id').val(), 'modulo': 'nasparadas'});
  36.             }
  37.         });
  38.        
  39.         $("#destaque").uploadify({
  40.             'uploader'      : '/scripts/uploadify/uploadify.swf',
  41.             'script'        : '/nasparadas.upload',
  42.             'cancelImg'     : '/scripts/uploadify/cancel.png',
  43.             'width'         : '120',
  44.             'height'        : '30',
  45.             'wmode'         : 'transparent',
  46.             'fileDataName'  : 'imgDestaque',
  47.             'fileExt'       : '*.jpg',
  48.             'fileDesc'      : 'Imagens JPG',
  49.             'auto'          : true,
  50.             'multi'         : false,
  51.             'removeComplete': false,
  52.             'buttonText'    : 'Arquivo',
  53.             'onComplete'    : function (event, queueID, fileObj, response, data) {
  54.                 if (response != "") {
  55.                     //alert('Event: '+JSON.stringify(event)+'\nqueueId: '+JSON.stringify(queueID)+'\nfileObj: '+JSON.stringify(fileObj)+'\nResponse: '+JSON.stringify(response)+'\nData: '+JSON.stringify(data));
  56.                     $('#campo_destaque div').html('<img src="/images/nasparadas/'+response+'_d.jpg?w=50&h=50&c=3&cor=000&data='+(new Date()).getTime()+'" alt="">');
  57.                     return true;
  58.                 }
  59.             },
  60.             'onError': function (event, queueID, fileObj, errorObj) {
  61.                 if (errorObj != "") {
  62.                     alert('Erro: '+errorObj.info);
  63.                     if (errorObj.info == 552) {
  64.                         alert('Você precisa entrar com sua conta para enviar uma foto.');
  65.                     } else if (errorObj.info == 553) {
  66.                         alert('Envie apenas arquivos .jpg');
  67.                     }
  68.                     $('#fuFotoPerfil').uploadifyClearQueue();
  69.                     return true;
  70.                 }
  71.             },
  72.             'onSelect': function (event, queueID, fileObj) {
  73.                 $('#arquivo').uploadifySettings('scriptData', { 'ASPSESSID': user.aspsessid, 'AUTH': user.auth, 'ID': $('#id').val(), 'Token': $('#id').val(), 'modulo': 'nasparadas'});
  74.             }
  75.         });
Add Comment
Please, Sign In to add comment