Showing posts with label Bangalore. Show all posts
Showing posts with label Bangalore. Show all posts

Monday, February 11, 2013

Sharpeoint internal names display..

<select id="spLists" onchange="displayFieldData(this.options[this.selectedIndex].value)"/>
<div id="spListsSelected"></div>
<table id="spListFieldTable" cellpadding="0" cellspacing="0" style="width: auto"></table>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<script type="text/javascript">
var siteURL = 'http://' + window.location.host + L_Menu_BaseUrl + '/_vti_bin/lists.asmx';
$(document).ready(function(){
 var soapEnv = "<soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'> \
     <soap:Body> \
     <GetListCollection xmlns='http://schemas.microsoft.com/sharepoint/soap/' /> \
     </soap:Body> \
     </soap:Envelope>";
 $.ajax({
  url: siteURL,beforeSend: function(xhr) {
   xhr.setRequestHeader("SOAPAction",
   "http://schemas.microsoft.com/sharepoint/soap/GetListCollection");
  },
  type: "POST",
  async: false,
  dataType: "xml",
  data: soapEnv,
  complete: processResult,
  contentType: "text/xml; charset=\"utf-8\""
 });
});
function processResult(xData, status) {
 $("#spLists").append("<option>Select a List</option>");
 $(xData.responseXML).find("List").each(function() {
 var liHtml = "<option value='" + $(this).attr("Title") + "'>" + $(this).attr("Title") + "</option>";
 $("#spLists").append(liHtml);
 });
}
function displayValue(splistname) {
 $("#spListsSelected").text(splistname);
}
</script>
<script type="text/javascript">
var arrSkipFieldTypesOf = ['Computed'];
var arrIncludeOverrideFields = ['Title','Author','Created','Modified','Editor'];
function displayFieldData(listname) {
 if(listname == "" || listname == undefined) return false;
 var soapEnv = "<soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'> \
     <soap:Body> \
     <GetList xmlns='http://schemas.microsoft.com/sharepoint/soap/'> \
     <listName>" + listname + "</listName> \
     </GetList> \
     </soap:Body> \
     </soap:Envelope>";
 $.ajax({
  url: siteURL,
  beforeSend: function(xhr) {
  xhr.setRequestHeader("SOAPAction",
  "http://schemas.microsoft.com/sharepoint/soap/GetList");
  },
  type: "POST",
  async: false,
  dataType: "xml",
  data: soapEnv,
  complete: processResult2,
  contentType: "text/xml; charset=\"utf-8\""
 });
}
function processResult2(xData, status) {
 $("#spListFieldTable tr").remove();
 $("#spListFieldTable").append("<tr style='font-weight:bold;'><td style='padding-right:10px'>DisplayName</td><td style='padding-right:10px'>FieldInternalName</td><td style='padding-right:10px'>FieldType</td></tr>");
 $(xData.responseXML).find("Field").each(function() {
  if (($.inArray($(this).attr('Name'),arrIncludeOverrideFields)>-1) || ($(this).attr('FromBaseType')!='TRUE' && $(this).attr('Sealed')!='TRUE' && $(this).attr('DisplayName')!=undefined && $.inArray($(this).attr('Type'),arrSkipFieldTypesOf)==-1)) {
   var trHtml = "<tr>";
   trHtml += "<td style='padding-right:10px'>" + $(this).attr("DisplayName") + "</td>";
   trHtml += "<td style='padding-right:10px'>" + $(this).attr("Name") + "</td>";
   trHtml += "<td style='padding-right:10px'>" + $(this).attr("Type") + "</td>";
   trHtml += "</tr>";
   $("#spListFieldTable").append(trHtml);
  }
 });
 $("#spListFieldTable tr:odd").css("background-color","rgb(206,206,206)");
}
</script>

Sunday, August 19, 2012

Sharepoint Tweeks and tricks

Is this even possible, some might wonder? Well it is, via querystring options on the command line:
Add Web Parts/Browse ToolPaneView=2
Add Web Parts/Search ToolPaneView=3
Edit Mode mode=edit
View Mode mode=view
Shared Mode PageView=Shared
Personal Mode PageView=Personal

So for example, say you wanted to edit the Shared view of the default page:
default.aspx?mode=edit&PageView=Shared
Say you wanted to Browse web parts and add them to your Personal view:
default.aspx?ToolPaneView=2&PageView=Personal
You can mix and match, and the order of the options do not matter....
Hope this helps
-Andy

Tuesday, July 24, 2012

Digital World Clock

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled 2</title>
<script language="JavaScript">
<!--
function worldClock(zone,MinI, region){
var dst = 0
var time = new Date()
var gmtMS = time.getTime() + (time.getTimezoneOffset() * 60000)
var gmtTime = new Date(gmtMS)
var day = gmtTime.getDate()
var month = gmtTime.getMonth()
var year = gmtTime.getYear()
if(year < 1000){
year += 1900
}
var monthArray = new Array("January", "February", "March", "April", "May", "June", "July", "August",
    "September", "October", "November", "December")
var monthDays = new Array("31", "28", "31", "30", "31", "30", "31", "31", "30", "31", "30", "31")
if (year%4 == 0){
monthDays = new Array("31", "29", "31", "30", "31", "30", "31", "31", "30", "31", "30", "31")
}
if(year%100 == 0 && year%400 != 0){
monthDays = new Array("31", "28", "31", "30", "31", "30", "31", "31", "30", "31", "30", "31")
}
var hr = gmtTime.getHours() + zone
var min = gmtTime.getMinutes()+ MinI
var sec = gmtTime.getSeconds()

if(min>59)
 {
 var min = gmtTime.getMinutes()-"30"
 var hr = hr+1
 }
if (hr >= 24){
hr = hr-24
day -= -1
}
if (hr < 0){
hr -= -24
day -= 1
}
if (hr < 10){
hr = " " + hr
}
if (min < 10){
 min = "0" + min}
if (sec < 10)
{
sec = "0" + sec
}
if (day <= 0){
if (month == 0){
 month = 11
 year -= 1
 }
 else{
 month = month -1
 }
day = monthDays[month]
}
if(day > monthDays[month]){
 day = 1
 if(month == 11){
 month = 0
 year -= -1
 }
 else{
 month -= -1
 }
}
if (region == "NAmerica"){
 var startDST = new Date()
 var endDST = new Date()
 startDST.setMonth(3)
 startDST.setHours(2)
 startDST.setDate(1)
 var dayDST = startDST.getDay()
 if (dayDST != 0){
  startDST.setDate(8-dayDST)
  }
  else{
  startDST.setDate(1)
  }
 endDST.setMonth(9)
 endDST.setHours(1)
 endDST.setDate(31)
 dayDST = endDST.getDay()
 endDST.setDate(31-dayDST)
 var currentTime = new Date()
 currentTime.setMonth(month)
 currentTime.setYear(year)
 currentTime.setDate(day)
 currentTime.setHours(hr)
 if(currentTime >= startDST && currentTime < endDST){
  dst = 1
  }
}
if (region == "Europe"){
 var startDST = new Date()
 var endDST = new Date()
 startDST.setMonth(2)
 startDST.setHours(1)
 startDST.setDate(31)
 var dayDST = startDST.getDay()
 startDST.setDate(31-dayDST)
 endDST.setMonth(9)
 endDST.setHours(0)
 endDST.setDate(31)
 dayDST = endDST.getDay()
 endDST.setDate(31-dayDST)
 var currentTime = new Date()
 currentTime.setMonth(month)
 currentTime.setYear(year)
 currentTime.setDate(day)
 currentTime.setHours(hr)
 if(currentTime >= startDST && currentTime < endDST){
  dst = 1
  }
}
if (region == "SAmerica"){
 var startDST = new Date()
 var endDST = new Date()
 startDST.setMonth(9)
 startDST.setHours(0)
 startDST.setDate(1)
 var dayDST = startDST.getDay()
 if (dayDST != 0){
  startDST.setDate(22-dayDST)
  }
  else{
  startDST.setDate(15)
  }
 endDST.setMonth(1)
 endDST.setHours(11)
 endDST.setDate(1)
 dayDST = endDST.getDay()
 if (dayDST != 0){
  endDST.setDate(21-dayDST)
  }
  else{
  endDST.setDate(14)
  }
 var currentTime = new Date()
 currentTime.setMonth(month)
 currentTime.setYear(year)
 currentTime.setDate(day)
 currentTime.setHours(hr)
 if(currentTime >= startDST || currentTime < endDST){
  dst = 1
  }
}
if (region == "Cairo"){
 var startDST = new Date()
 var endDST = new Date()
 startDST.setMonth(3)
 startDST.setHours(0)
 startDST.setDate(30)
 var dayDST = startDST.getDay()
 if (dayDST < 5){
  startDST.setDate(28-dayDST)
  }
  else {
  startDST.setDate(35-dayDST)
  }
 endDST.setMonth(8)
 endDST.setHours(11)
 endDST.setDate(30)
 dayDST = endDST.getDay()
 if (dayDST < 4){
  endDST.setDate(27-dayDST)
  }
  else{
  endDST.setDate(34-dayDST)
  }
 var currentTime = new Date()
 currentTime.setMonth(month)
 currentTime.setYear(year)
 currentTime.setDate(day)
 currentTime.setHours(hr)
 if(currentTime >= startDST && currentTime < endDST){
  dst = 1
  }
}
if (region == "India")
{
 var startDST = new Date()
 var endDST = new Date()
 startDST.setMonth(3)
 startDST.setHours(2)
 startDST.setDate(1)
 endDST.setMonth(8)
 endDST.setHours(2)
 endDST.setDate(25)
 dayDST = endDST.getDay()
 if (dayDST != 0){
 endDST.setDate(32-dayDST)
 }
 else{
 endDST.setDate(1)
 endDST.setMonth(9)
 }
 var currentTime = new Date()
 currentTime.setMonth(month)
 currentTime.setYear(year)
 currentTime.setDate(day)
 currentTime.setHours(hr)
 if(currentTime >= startDST && currentTime < endDST){
  dst = 1
  }

}
if (region == "Beirut"){
 var startDST = new Date()
 var endDST = new Date()
 startDST.setMonth(2)
 startDST.setHours(0)
 startDST.setDate(31)
 var dayDST = startDST.getDay()
 startDST.setDate(31-dayDST)
 endDST.setMonth(9)
 endDST.setHours(11)
 endDST.setDate(31)
 dayDST = endDST.getDay()
 endDST.setDate(30-dayDST)
 var currentTime = new Date()
 currentTime.setMonth(month)
 currentTime.setYear(year)
 currentTime.setDate(day)
 currentTime.setHours(hr)
 if(currentTime >= startDST && currentTime < endDST){
  dst = 1
  }
}
if (region == "Baghdad"){
 var startDST = new Date()
 var endDST = new Date()
 startDST.setMonth(3)
 startDST.setHours(3)
 startDST.setDate(1)
 endDST.setMonth(9)
 endDST.setHours(3)
 endDST.setDate(1)
 dayDST = endDST.getDay()
  var currentTime = new Date()
 currentTime.setMonth(month)
 currentTime.setYear(year)
 currentTime.setDate(day)
 currentTime.setHours(hr)
 if(currentTime >= startDST && currentTime < endDST){
  dst = 1
  }
}
if (region == "Australia"){
 var startDST = new Date()
 var endDST = new Date()
 startDST.setMonth(9)
 startDST.setHours(2)
 startDST.setDate(31)
 var dayDST = startDST.getDay()
 startDST.setDate(31-dayDST)
 endDST.setMonth(2)
 endDST.setHours(2)
 endDST.setDate(31)
 dayDST = endDST.getDay()
 endDST.setDate(31-dayDST)
 var currentTime = new Date()
 currentTime.setMonth(month)
 currentTime.setYear(year)
 currentTime.setDate(day)
 currentTime.setHours(hr)
 if(currentTime >= startDST || currentTime < endDST){
  dst = 1
  }
}

if (dst == 1){
 hr -= -1
 if (hr >= 24){
 hr = hr-24
 day -= -1
 }
 if (hr < 10){
 hr = " " + hr
 }
 if(day > monthDays[month]){
 day = 1
 if(month == 11){
 month = 0
 year -= -1
 }
 else{
 month -= -1
 }
 }
return monthArray[month] + " " + day + ", " + year + "<br>" + hr + ":" + min + ":" + sec + " DST"
}
else{
return monthArray[month] + " " + day + ", " + year + "<br>" + hr + ":" + min + ":" + sec
}
}
function worldClockZone(){
document.getElementById("GMT").innerHTML = worldClock(0,0, "Greenwich")
document.getElementById("Melbourne").innerHTML = worldClock(10,0, "Australia")
document.getElementById("Bangalore").innerHTML = worldClock(4,30, "India")
document.getElementById("Manila").innerHTML = worldClock(8,0, "Singapore")
document.getElementById("NewYork").innerHTML = worldClock(-5,0, "NAmerica")
document.getElementById("NZ").innerHTML = worldClock(12,0, "Australia")
document.getElementById("Singapore").innerHTML = worldClock(8,0, "Singapore")
setTimeout("worldClockZone()", 1000)
}
window.onload=worldClockZone;
//-->
</script>
<style type="text/css">
.body {
color: #000;
}
.hrow {
font-weight:bold;
color: #000;
}
.hrow td{
padding-top: 20px;
width: 140px;
}
</style>
</head>
<body>
<table cellspacing="5px" align="center">
<tr class="hrow">
<td>GMT</td>
<td>Melbourne</td>
<td>Bangalore</td>
<td>Manila</td>
<td>New York</td>
<td>Auckland</td>
<td>Singapore</td>
</tr>
<tr>
<td><font color="#004165"> <span id="GMT"></span></font></td>
<td><font color="#004165"> <span id="Melbourne"></span></font></td>
<td><font color="#004165"> <span id="Bangalore"></span></font></td>
<td><font color="#004165"> <span id="Manila"></span></font></td>
<td><font color="#004165"> <span id="NewYork"></span></font></td>
<td><font color="#004165"> <span id="NZ"></span></font></td>
<td><font color="#004165"> <span id="Singapore"></span></font></td>
</tr>

</table>

</body>
</html>

Followers

No Locks without Key

🌿 Bible Verse 1 Corinthians 10:13 "No temptation has overtaken you except what is common to mankind. And God is faithful; ...

Who Am I?

My photo
What is mankind that you are mindful of them, human beings that you care for them? Psalms 8:4 But he made us a little lower than Angels and Crowned with Glory and Honor. How majestic is your name in all the Earth Oh Lord our God!