Guest User

hasCustomType.js

a guest
Sep 7th, 2017
77
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.87 KB | None
  1. (function()
  2. {
  3. /**
  4. * Alfresco Slingshot aliases
  5. */
  6. var $html = Alfresco.util.encodeHTML,
  7. $isValueSet = Alfresco.util.isValueSet;
  8.  
  9. var $html5 = Alfresco.util.encodeHTML,
  10. $isValueSet = Alfresco.util.isValueSet;
  11.  
  12.  
  13. if (Alfresco.DocumentList)
  14. { YAHOO.Bubbling.fire("registerRenderer",
  15. {
  16. propertyName: "FolderInfo",
  17.  
  18. renderer: function type_renderer(record)
  19. {
  20. var jsNode = record.jsNode;
  21. var nodeRef = jsNode.nodeRef;
  22. var size, noOfFiles;
  23.  
  24. console.log(size);
  25. console.log(Alfresco.constants.PROXY_URI + "com/acme/nodesize/node-size.json?nodeRef=" + nodeRef);
  26.  
  27. /*Alfresco.util.Ajax.jsonGet({*/
  28. $.ajax({
  29. url: encodeURI(Alfresco.constants.PROXY_URI + 'com/acme/nodesize/node-size.json?nodeRef='+nodeRef),
  30. async: false,
  31. successCallback:
  32. {
  33. fn: function loadWebscript_successCallback(response, config)
  34. {
  35. var obj = JSON.parse(response.serverResponse.responseText);
  36. if (obj)
  37. {
  38. console.log("AJAX calls works. Printing the folder size " + obj.size + " & no of files " + obj.noOfFiles);
  39. size = obj.size;
  40. noOfFiles = obj.noOfFiles;
  41. alert(size);
  42. console.log("inside success call back function");
  43. /* console.log("Size"+size);
  44. html5 = '<span class="item">' + "Folder Size: " + '<b>' + size + '</b>' + '</span>';
  45. return html5;*/
  46. /*printSize();*/
  47. }
  48. },
  49. /*scope: this*/
  50. },
  51. /*scope: this*/
  52. });
  53. /*function printSize(){*/
  54. console.log("Size"+size);
  55. html5 = '<span class="item">' + "Folder Size: " + '<b>' + size + '</b>' + '</span>';
  56. return html5;
  57. /*}*/
  58.  
  59. }
  60. });
  61. }
  62.  
  63.  
  64.  
  65. })();
RAW Paste Data Copied