[icinga-checkins] icinga.org: icinga-web/cdoebler/default: * Weekend save

git at icinga.org git at icinga.org
Thu Jan 28 15:06:07 CET 2010


Module: icinga-web
Branch: cdoebler/default
Commit: 9450342aec8ac3646829d3336f1cbfe77860a622
URL:    https://git.icinga.org/?p=icinga-web.git;a=commit;h=9450342aec8ac3646829d3336f1cbfe77860a622

Author: Marius Hein <mhein at sasquatch.local.itsocks.de>
Date:   Fri Jan 22 16:11:29 2010 +0100

* Weekend save

---

 .../Cronks/templates/System/IframeViewSuccess.php  |   39 +++++++++++++++++---
 .../Cronks/templates/System/PortalViewSuccess.php  |   13 ++-----
 2 files changed, 37 insertions(+), 15 deletions(-)

diff --git a/app/modules/Cronks/templates/System/IframeViewSuccess.php b/app/modules/Cronks/templates/System/IframeViewSuccess.php
index d29d870..da71e13 100644
--- a/app/modules/Cronks/templates/System/IframeViewSuccess.php
+++ b/app/modules/Cronks/templates/System/IframeViewSuccess.php
@@ -1,25 +1,35 @@
 <?php 
 	$url = $t['url'];
 	$parentid = $rd->getParameter('parentid');
-	$newid = 'iframe-'. AppKitRandomUtil::genSimpleId(10);
 	$stateuid = $rd->getParameter('stateuid');
 ?>
 <?php if ($url) { ?>
 <script type="text/javascript">
 (function() { 
+	
 	var cParent = Ext.getCmp('<?php echo $parentid; ?>');
 	var stateuid = '<?php echo $stateuid; ?>';
 	
+	var newid = AppKit.Ext.genRandomId('iframe'); 
+	var domid = newid + '-dom';
+	
 	// Create a new panel with a modified body element
 	var config = {
-		id: '<?php echo $newid; ?>',
+		id: newid,
 		listeners: {
 			
 			beforerender: function(ct) {
 				this.bodyCfg = {
 					tag: 'iframe',
-					src: '<?php echo $url ?>'
+					src: '<?php echo $url ?>',
+					id: domid
 				};
+				
+				Ext.EventManager.on(window, 'unload', function() {
+					this.saveState();
+				}, this);
+				
+				return true;
 			}
 			
 		}
@@ -27,12 +37,31 @@
 	
 	if (stateuid) {
 		Ext.apply(config, {
+			stateId: stateuid,
+			stateEvents: ['unload'],
 			stateful: true,
-			stateId: stateuid
+			
+			getState: function() {
+				var url = null;
+				
+				var e = this.body.dom;
+				if (e.contentDocument) {
+					url = e.contentWindow.location.href;
+				}
+				
+				return {
+					url: url
+				};
+			},
+			
+			applyState: function(state) {
+				return true;
+			}
 		});
 	}
 	
-	// Insert the element (no add, because reload results in multiple items)
+	
+	// Insert he element (no add, because reload results in multiple items)
 	cParent.insert(0, new Ext.Panel(config));
 	
 	// Notify about changes
diff --git a/app/modules/Cronks/templates/System/PortalViewSuccess.php b/app/modules/Cronks/templates/System/PortalViewSuccess.php
index c8247c0..8e8bd5b 100644
--- a/app/modules/Cronks/templates/System/PortalViewSuccess.php
+++ b/app/modules/Cronks/templates/System/PortalViewSuccess.php
@@ -57,7 +57,9 @@
 							
 							notifyOver: function(dd, e, data) {
 								
-		//						console.log("--- START ---");
+								if (data.dragData.id.indexOf('portalView') == 0) {
+									return false;
+								}
 								
 								if (!this.grid) {
 									this.grid = p.dd.getGrid();
@@ -65,23 +67,14 @@
 								
 								var xy = e.getXY();
 								
-		//						console.log(xy);
-		//						console.log(this.grid.columnX);
-								
 								Ext.iterate(this.grid.columnX, function (item, index, arry) {
 									
-		//						console.log(item);
-		// 	
 									if (xy[0] >= item.x && xy[0] < item.x+item.w ) {
 										this.ac = index;
 										return false;
 									}
 									
 							}, this);
-								
-		//						console.log(this.ac);
-		//						
-		//						console.log("--- STOP ---");
 		
 								return Ext.dd.DropTarget.prototype.notifyOver.call(this, dd, e, data);
 							},





More information about the icinga-checkins mailing list