Changeset f320564a9131…
Parent 98193e382721…
by
Changes to 4 files · Browse files at f320564a9131 Showing diff from parent 98193e382721 Diff from another changeset...
@@ -39,5 +39,5 @@ // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("0.1.0.0")]
-[assembly: AssemblyFileVersion("0.1.0.0")] // adam - Added this cool new FogBugz plugin!
+[assembly: AssemblyVersion("0.1.1.0")]
+[assembly: AssemblyFileVersion("0.1.1.0")]
|
@@ -50,6 +50,9 @@ <Compile Include="TimeIntervalExample.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
+ <ItemGroup>
+ <Content Include="static\js\TimeIntervalExample.js" />
+ </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
|
|
@@ -0,0 +1,81 @@ + var TimeIntervalExamplePlugin = new function(){
+ var oSelf = this;
+
+ this.doPopup = function(elPopupAnchor)
+ {
+ oSelf.Popup.setHtml(
+ '<form id="TimeIntervalExamplePluginForm" onsubmit="TimeIntervalExamplePlugin.Popup.hide(); postTimeIntervalComment(); return false;">\n' +
+ '<h1><label for="comment">Comment:</label></h1>' +
+ '<div>' +
+ '<input type="hidden" name="ixInterval" value="-1">' +
+ '<input type="text" id="comment" name="comment">' +
+ '</div>' +
+ '<br /><nobr><input type="submit" value="' + FB_OK + '" class="dlgButton"> ' +
+ '<input type="button" onclick="TimeIntervalExamplePlugin.Popup.hide(); return false;" value="' + FB_CANCEL+ '" class="dlgButton"></nobr>' +
+ '</form>' +
+ '<script type="text/javascript">' +
+
+ '$("form#TimeIntervalExamplePluginForm input[name=ixInterval]").val("' + elPopupAnchor.attributes.getNamedItem("ixInterval").value + '");' +
+ 'getTimeIntervalComment(' + elPopupAnchor.attributes.getNamedItem("ixInterval").value + ');' +
+ '</script>');
+ oSelf.Popup.showPopup(elPopupAnchor);
+ return false;
+ }
+
+ $(document).ready(function(){
+ oSelf.Popup = api.PopupManager.newPopup("TimeIntervalExamplePlugin");
+ });
+}();
+
+function doTimesheetMagic(){
+ // put your jQuery magic here that manipulates the timesheet table
+ // keep in mind that this code will be called each time the timesheet dialog is displayed
+ var i = 0;
+ jQuery("#idTimesheetTable tbody tr").each( function(index)
+ {
+ var thisId = $(this).attr("id");
+ if (i == 0)
+ {
+ $(this).append("<th> </th>");
+ }
+ else if (i > 0)
+ {
+ if (thisId.length > 0)
+ {
+ var ixInterval = thisId.substring(thisId.indexOf("_") + 1);
+ $(this).append('<td><a href="#" ixInterval="' + ixInterval + '" onclick="TimeIntervalExamplePlugin.doPopup(this); return false;">' + ixInterval + '</a></td>');
+ }
+ else
+ {
+ $(this).append("<th> </th>");
+ i = -2;
+ }
+ }
+ i++;
+ });
+}
+var nWaitCount = 0;
+function waitForTimesheetReady(){
+ console.log('lookin for timesheet table...');
+ if($('#idTimesheetTable').length === 0 && nWaitCount < 10){
+ console.log('not found, so wait a bit');
+ nWaitCount++;
+ setTimeout(waitForTimesheetReady, 200);
+ }else{
+ console.log('found it! now do stuff...');
+ doTimesheetMagic();
+ }
+}
+var oldShow = ClockPopup.show;
+ClockPopup.show = function(){
+ console.log('Calling ClockPopup.show()...');
+ var result = oldShow.apply(ClockPopup, arguments);
+ nWaitCount = 0;
+ waitForTimesheetReady();
+ return result;
+};
+
+function myCallback(sHTML, status)
+{
+ alert(sHTML);
+}
\ No newline at end of file |
Loading...