Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function()
- {
- /**
- * Alfresco Slingshot aliases
- */
- var $html = Alfresco.util.encodeHTML,
- $isValueSet = Alfresco.util.isValueSet;
- var $html5 = Alfresco.util.encodeHTML,
- $isValueSet = Alfresco.util.isValueSet;
- if (Alfresco.DocumentList)
- { YAHOO.Bubbling.fire("registerRenderer",
- {
- propertyName: "FolderInfo",
- renderer: function type_renderer(record)
- {
- var jsNode = record.jsNode;
- var nodeRef = jsNode.nodeRef;
- var size, noOfFiles;
- console.log(size);
- console.log(Alfresco.constants.PROXY_URI + "com/acme/nodesize/node-size.json?nodeRef=" + nodeRef);
- /*Alfresco.util.Ajax.jsonGet({*/
- $.ajax({
- url: encodeURI(Alfresco.constants.PROXY_URI + 'com/acme/nodesize/node-size.json?nodeRef='+nodeRef),
- async: false,
- successCallback:
- {
- fn: function loadWebscript_successCallback(response, config)
- {
- var obj = JSON.parse(response.serverResponse.responseText);
- if (obj)
- {
- console.log("AJAX calls works. Printing the folder size " + obj.size + " & no of files " + obj.noOfFiles);
- size = obj.size;
- noOfFiles = obj.noOfFiles;
- alert(size);
- console.log("inside success call back function");
- /* console.log("Size"+size);
- html5 = '<span class="item">' + "Folder Size: " + '<b>' + size + '</b>' + '</span>';
- return html5;*/
- /*printSize();*/
- }
- },
- /*scope: this*/
- },
- /*scope: this*/
- });
- /*function printSize(){*/
- console.log("Size"+size);
- html5 = '<span class="item">' + "Folder Size: " + '<b>' + size + '</b>' + '</span>';
- return html5;
- /*}*/
- }
- });
- }
- })();
Add Comment
Please, Sign In to add comment