Skip to main content

Posts

Showing posts from September, 2014

Photo Zoom option script

// Magnific Popup v0.9.9 by Dmitry Semenov // http://bit.ly/magnific-popup#build=inline+image+ajax+iframe+gallery+retina+imagezoom+fastclick (function(a){var b="Close",c="BeforeClose",d="AfterClose",e="BeforeAppend",f="MarkupParse",g="Open",h="Change",i="mfp",j="."+i,k="mfp-ready",l="mfp-removing",m="mfp-prevent-close",n,o=function(){},p=!!window.jQuery,q,r=a(window),s,t,u,v,w,x=function(a,b){n.ev.on(i+a+j,b)},y=function(b,c,d,e){var f=document.createElement("div");return f.className="mfp-"+b,d&&(f.innerHTML=d),e?c&&c.appendChild(f):(f=a(f),c&&f.appendTo(c)),f},z=function(b,c){n.ev.triggerHandler(i+b,c),n.st.callbacks&&(b=b.charAt(0).toLowerCase()+b.slice(1),n.st.callbacks[b]&&n.st.callbacks[b].apply(n,a.isArray(c)?c:[c]))},A=function(b){if(b!==w||!n.currTemplate.closeBtn)n.currTemplate.closeBtn=a(n.st.close...

ShowHidePagecontrol based on user permissions in SharePoint using javascript

$(document).ready(function (){         getCurrentUserRole();  });  function getCurrentUserRole() {     var userPerm;     $().SPServices({         operation: "GetRolesAndPermissionsForCurrentUser",         async: false,         completefunc: function (xData, Status) {             //if( Status == "success") {             userPerm = $(xData.responseXML).SPFilterNode("Permissions").attr("Value");             //alert(userPerm);                         var nonAdminP = (33554432 & userPerm) == 33554432;         ...

Upload only PDF and XSL files for SharePoint Lists

function OkAttach() {     a: ;     var g = FileuploadString + String(FileUploadIndex), b = GetAttachElement(g), f = TrimWhiteSpaces(b.value);     if (!Boolean(f)) {         alert(Strings.STS.L_FileNameRequired_TXT);         b.focus()     }      else if(CustomizedCheck(b.value)==false) {            if(_spPageContextInfo.serverRequestPath.indexOf("Listname1") > -1)            {             alert("Invalid File Type. (Only PDF/PPTX files are allowed.)");            }            else if(_spPageContextInfo.serverRequestPath.indexOf("ListName2") > -1)        ...

Getting SharePoint List attachments in the SPGrid or Asp grid

In ascx or aspx file add the below code : <script type="text/javascript">        var listName = "List Name";        function deleteListItem(ID) {         var siteUrl = 'Site URL';         this.itemId = ID;         var clientContext = new SP.ClientContext(siteUrl);         var oList = clientContext.get_web().get_lists().getByTitle('List Name);         this.oListItem = oList.getItemById(itemId);         oListItem.deleteObject();         clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));     }     function onQuerySucceeded(data) {         al...