src/cm/media/js/site/f_text_view_frame.js
changeset 103 61fd17f9ab78
parent 59 8a2d933209aa
child 206 38aa907c6479
--- a/src/cm/media/js/site/f_text_view_frame.js	Wed Jan 13 18:15:21 2010 +0100
+++ b/src/cm/media/js/site/f_text_view_frame.js	Wed Jan 20 20:43:38 2010 +0100
@@ -181,6 +181,7 @@
 	var viewFirst = gettext('view first comment') ;
 	var viewLast = gettext('view last next comment') ;
 	var viewAll = gettext('view all comments') ;
+	var viewScopeRemoved = gettext('view all detached comments') ;
 	var advancedInterface = gettext('toggle advance interface') ;
 	var print = gettext('print document with/without comments') ;
 	var exportDoc = gettext('export document with/without comments') ;
@@ -232,6 +233,9 @@
 			'<a href="#" id="c_browse_all"><img title="'+ viewAll +'" alt="'+ viewAll +'" src="' + sv_media_url + '/img/view_all.png"/></a>' +
 			'</td>' +
 			'<td width="20" align="left">' +
+			'<a href="#" id="c_browse_scope_removed"><img title="'+ viewScopeRemoved +'" alt="'+ viewScopeRemoved +'" src="' + sv_media_url + '/img/view_scope_removed2.png"/></a>' +
+			'</td>' +
+			'<td width="20" align="left">' +
 				'<a href="#" id="c_advanced_btn"><img title="'+ advancedInterface +'" alt="'+ advancedInterface +'" src="' + sv_media_url + '/img/application_split.png"/></a>' +
 			'</td>' +
 			'<td width="20" align="left">' +
@@ -286,6 +290,14 @@
 		}
 	});
 	
+	$("#c_browse_scope_removed").click( function() {
+		if (frames['text_view_comments'].readyForAction()) {
+			frames['text_view_comments'].checkForOpenedDialog(null, function() {
+				frames['text_view_comments'].gSync.showScopeRemovedComments() ;
+			}) ;
+		}
+	});
+	
 	$("#c_print_btn").click( function() {
 		if (frames['text_view_comments'].readyForAction()) {
 			var ids = frames['text_view_comments'].gDb.getFilteredCommentIdsAsString() ;
@@ -746,39 +758,41 @@
 gInFullScreen = false;
 
 _setFrameSize = function() {
-	if (gInFullScreen) {
-		var headerHeight = parent.$("#header").height();
-		var windowHeight = parent.$(parent).height();
-		var frameHeight = (windowHeight - headerHeight - 2) + 'px'; // - 2 to prevent scrollbars ? --> TODO test it without -2
-
-		var windowWidth = parent.$(parent).width();
-		var frameWidth = (windowWidth - 2) + 'px'; // - 2 to prevent scrollbars ?// --> TODO test it without -2
-
-		// TODO we should be embeded ! shouldn't work otherwise anyway (frame security concerns)
-		parent.$("#text_view_frame").css( {
-			'position' :'absolute',
-			'left' :'0px',
-			'top' :headerHeight,
-			'width' :frameWidth,
-			'height' :frameHeight
-		});
-	}
-	else {
-		var frameTop = Math.ceil(parent.$("#autoexpand_text_view_frame_container").position()["top"]);
-
-		var windowHeight = parent.$(parent).height();
-		var frameHeight = (windowHeight - frameTop - 2) + 'px'; // - 2 to prevent scrollbars // ? --> TODO test it without -2
-		
-		var windowWidth = parent.$(parent).width();
-		var frameWidth = (windowWidth - 2) + 'px'; // - 2 to prevent scrollbars ? // --> TODO test it without -2
-
-		// TODO test if we're embeded ! wont work otherwise anyway (frame security)
-		parent.$("#text_view_frame").css( {
-			'position' :'relative',
-			'width' :'99.9%',
-			'height' :frameHeight,
-			'top' :'0px'
-		});
+	if (parent != window) { // (this condition is to enable accessing "comments_frame" view from top window) TODO test under IE   
+		if (gInFullScreen) {
+			var headerHeight = parent.$("#header").height();
+			var windowHeight = parent.$(parent).height();
+			var frameHeight = (windowHeight - headerHeight - 2) + 'px'; // - 2 to prevent scrollbars ? --> TODO test it without -2
+	
+			var windowWidth = parent.$(parent).width();
+			var frameWidth = (windowWidth - 2) + 'px'; // - 2 to prevent scrollbars ?// --> TODO test it without -2
+	
+			// TODO we should be embeded ! shouldn't work otherwise anyway (frame security concerns)
+			parent.$("#text_view_frame").css( {
+				'position' :'absolute',
+				'left' :'0px',
+				'top' :headerHeight,
+				'width' :frameWidth,
+				'height' :frameHeight
+			});
+		}
+		else {
+			var frameTop = Math.ceil(parent.$("#autoexpand_text_view_frame_container").position()["top"]);
+	
+			var windowHeight = parent.$(parent).height();
+			var frameHeight = (windowHeight - frameTop - 2) + 'px'; // - 2 to prevent scrollbars // ? --> TODO test it without -2
+			
+			var windowWidth = parent.$(parent).width();
+			var frameWidth = (windowWidth - 2) + 'px'; // - 2 to prevent scrollbars ? // --> TODO test it without -2
+	
+			// TODO test if we're embeded ! wont work otherwise anyway (frame security)
+			parent.$("#text_view_frame").css( {
+				'position' :'relative',
+				'width' :'99.9%',
+				'height' :frameHeight,
+				'top' :'0px'
+			});
+		}
 	}
 }
 _toFullScreenSize = function() {