[Fusionforge-commits] FusionForge branch 6.0 updated. v6.0.3-69-g7128c3a

Franck Villaume nerville at libremir.placard.fr.eu.org
Sun Jan 24 20:33:57 CET 2016


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FusionForge".

The branch, 6.0 has been updated
       via  7128c3a3a046f1b1f55a31c8b37bdf9ed0532afe (commit)
      from  0992853f3fbdc2e91ea83925b478d0b64e3bcbcc (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=7128c3a3a046f1b1f55a31c8b37bdf9ed0532afe

commit 7128c3a3a046f1b1f55a31c8b37bdf9ed0532afe
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Sun Jan 24 20:33:22 2016 +0100

    fix [#802] wrong browsing history in scmgit

diff --git a/src/CHANGES b/src/CHANGES
index ffd5282..4ffc437 100644
--- a/src/CHANGES
+++ b/src/CHANGES
@@ -13,6 +13,7 @@ FusionForge 6.0.4:
 * Plugin cvstracker: fix permission issues 
 * Plugin SCM: fix another race condition when creating project with SCM selected (Inria)
 * Plugin SCM Git: improve user matching when computing stats, support git .mailmap (Inria)
+* Plugin SCM Git: fix history browsing. Merge Patch from Sieu Truc [#802] (TrivialDev)
 * Plugin SCM SVN: fix HTTP commit access for old SVN 1.7 clients (Inria)
 * Plugin scmhook: fix non-editable mailing list name in some configurations (Inria)
 * Plugin scmhook: fix migration scripts svntracker To ScmhookCommitTracker & svncommitemail To ScmHookCommitEmail (TrivialDev)
diff --git a/src/common/include/plugins_utils.php b/src/common/include/plugins_utils.php
index f20270a..e6dd838 100644
--- a/src/common/include/plugins_utils.php
+++ b/src/common/include/plugins_utils.php
@@ -2,6 +2,7 @@
 /**
  * Copyright 2010 (c) Mélanie Le Bail
  * Copyright 2014,2015 Franck Villaume - TrivialDev
+ * Copyright 2015, Sieu Truc
  * http://fusionforge.org
  *
  * This file is part of FusionForge. FusionForge is free software;
@@ -89,12 +90,20 @@ function htmlIframeResizer($url, $poub = array()) {
 		html_use_iframeresizer();
 		echo $HTML->getJavascripts();
 		echo '<script type="text/javascript">//<![CDATA[
-			jQuery(\'iframe\').iFrameResize();
-			jQuery(\'iframe\').load(function (){
-					if (this.contentWindow.location.href == "'.util_make_url('/projects/'.$project->getUnixName()).'/") {
-						window.location.href = this.contentWindow.location.href;
-					}
-				});
+			jQuery(\'#'.$id.'\').iFrameResize();
+			function messageHandler (evt) {
+				var matches = jQuery(\'#'.$id.'\')[0].src.match(/^(https?\:\/\/[^\/?#]+)(?:[\/?#]|$)/i);
+				var domain = matches && matches[1];
+				if (evt.origin === domain && evt.data.indexOf("http") === 0) {
+					window.location.href = evt.data;
+				}
+			}
+			if (window.addEventListener) {
+				// For standards-compliant web browsers
+				window.addEventListener("message", messageHandler, false);
+			} else {
+				window.attachEvent("onmessage", messageHandler);
+			}
 			//]]></script>';
 	}
 }
diff --git a/src/plugins/scmgit/common/GitPlugin.class.php b/src/plugins/scmgit/common/GitPlugin.class.php
index aefb18c..31e8f78 100644
--- a/src/plugins/scmgit/common/GitPlugin.class.php
+++ b/src/plugins/scmgit/common/GitPlugin.class.php
@@ -605,6 +605,7 @@ control over it to the project's administrator.");
 		fwrite($f, "\$javascript = '". util_make_url('/plugins/scmgit/gitweb.js')."';\n");
 		fwrite($f, "\$site_html_head_string = '<script type=\"text/javascript\" src=\"". util_make_url('/scripts/iframe-resizer/iframeResizer.contentWindow.min.js'). "\" />';\n");
 		fwrite($f, "\$prevent_xss = 'true';\n");
+		fwrite($f, "\$site_footer = '".forge_get_config('source_path')."/plugins/scmgit/www/gitweb_footer.html';\n");
 		fwrite($f, "\$feature{'actions'}{'default'} = [('project home', '" .
 		       util_make_url('/plugins/scmgit/?func=grouppage/%n') .
 		       "', 'summary')];\n");
diff --git a/src/plugins/scmgit/www/gitweb_footer.html b/src/plugins/scmgit/www/gitweb_footer.html
new file mode 100644
index 0000000..da69a65
--- /dev/null
+++ b/src/plugins/scmgit/www/gitweb_footer.html
@@ -0,0 +1,60 @@
+<!--
+ * FusionForge SCM Git Plugin
+ *
+ * Copyright 2015, Sieu Truc
+ * Copyright 2015, Franck Villaume - TrivialDev
+ * http://fusionforge.org
+ *
+ * This file is part of FusionForge. FusionForge is free software;
+ * you can redistribute it and/or modify it under the terms of the
+ * GNU General Public License as published by the Free Software
+ * Foundation; either version 2 of the Licence, or (at your option)
+ * any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with FusionForge; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+-->
+
+<script type="text/javascript">
+<![CDATA[
+function inIframe() {
+    try {
+        return window.self !== window.top;
+    } catch (e) {
+        return true;
+    }
+}
+
+if(typeof(String.prototype.trim) === "undefined")
+{
+    String.prototype.trim = function()
+    {
+        return String(this).replace(/^\s+|\s+$/g, '');
+    };
+}
+(function() {
+	if(inIframe()) {
+		var anchors = document.getElementsByTagName('a');
+		for (var i = 0; i < anchors.length; i++) {
+			var anchor = anchors[i];
+			if(anchor.href.indexOf('func=grouppage') != -1) {
+				anchor.addEventListener('click', function(event) {
+					var iframeWin = window.parent;
+					var fullDomain = this.protocol+"//"+this.host;
+					if(this.port)
+						fullDomain += ":"+this.port;
+					iframeWin.postMessage(this.href, fullDomain);
+					event.preventDefault();
+				}, false);
+			}
+		}
+	}
+})()
+]]>
+</script>

-----------------------------------------------------------------------

Summary of changes:
 src/CHANGES                                   |  1 +
 src/common/include/plugins_utils.php          | 21 +++++++---
 src/plugins/scmgit/common/GitPlugin.class.php |  1 +
 src/plugins/scmgit/www/gitweb_footer.html     | 60 +++++++++++++++++++++++++++
 4 files changed, 77 insertions(+), 6 deletions(-)
 create mode 100644 src/plugins/scmgit/www/gitweb_footer.html


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list