From 8dd55eb949a5454a8ed6ffe99a5fd8854d5d20b4 Mon Sep 17 00:00:00 2001
From: yu huang <286417333@qq.com>
Date: Sat, 29 Aug 2015 19:13:54 -0400
Subject: [PATCH 1/4] Update footer.html
---
app/views/admin/footer.html | 17 -----------------
1 file changed, 17 deletions(-)
diff --git a/app/views/admin/footer.html b/app/views/admin/footer.html
index 6522874..a8b9e28 100644
--- a/app/views/admin/footer.html
+++ b/app/views/admin/footer.html
@@ -11,20 +11,3 @@
-
\ No newline at end of file
From 05a5280162b9e404ab220f2b517401a89a7ce849 Mon Sep 17 00:00:00 2001
From: yu huang <286417333@qq.com>
Date: Sat, 29 Aug 2015 19:15:08 -0400
Subject: [PATCH 2/4] move inline script code to admin.js
From 6d7fe834695835fea6d9195392d1008a1fd0395f Mon Sep 17 00:00:00 2001
From: yu huang <286417333@qq.com>
Date: Sat, 29 Aug 2015 19:19:11 -0400
Subject: [PATCH 3/4] move script from footer.js
have fixed bug of multiple active of email and send to users.
also make URL like "http://localhost:9000/admin/t?p=0&t=email/sendToUsers" work.
---
public/admin/js/admin.js | 67 ++++++++++++++++++++++++++++++----------
1 file changed, 51 insertions(+), 16 deletions(-)
diff --git a/public/admin/js/admin.js b/public/admin/js/admin.js
index 0c28c87..517adeb 100644
--- a/public/admin/js/admin.js
+++ b/public/admin/js/admin.js
@@ -274,21 +274,56 @@ function goNowToDatetime(goNow) {
!function ($) {
$(function(){
- // life
- $(".nav li > a").click(function(e) {
- $p = $(this).closest("ul");
- var $li = $(this).closest("li");
- if($li.find("ul").length == 0) {
- return true;
- }
- e.preventDefault();
- var hasClass = $li.hasClass("active");
- $p.find("li").removeClass("active");
- if(hasClass) {
- } else {
- $li.addClass("active");
- }
- });
+ //navigation
+ !function ($) {
+ /**
+ * description
+ * every href must begin with "?t="
+ */
+ //initial
+ function getParameterByName(name, queryString) {
+ name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); //address array [] condiion
+ var regex = new RegExp("[\\?&]" + name + "=([^]*)"),
+ results = regex.exec(queryString);
+ return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
+ }
+
+ var pathname = window.location.pathname; // admin/t
+ var search = window.location.search; // ?t=xxx
+ var fullPath = pathname;
+
+ //test case
+ //http://localhost:9000/admin/t?p=0&t=email/sendToUsers
+ //t=email/sendToUsers and t=email/send
+ var paramId = getParameterByName("t",window.location.search)
+ if(paramId !== "") {
+ var fullPath = pathname + "?t=" + paramId; // /admin/t?t=xxx
+ }
+
+ $("#nav > li").removeClass("active");
+
+ var $thisLi = $('#nav a[href="' + fullPath + '"]').parent();
+ // 自己
+ $thisLi.addClass("active");
+ // 父也active
+ $thisLi.parent().parent().addClass('active');
+
+ // event binding
+ $(".nav li > a").click(function(e) {
+ $p = $(this).closest("ul");
+ var $li = $(this).closest("li");
+ if($li.find("ul").length == 0) {
+ return true;
+ }
+ e.preventDefault();
+ var hasClass = $li.hasClass("active");
+ $p.find("li").removeClass("active");
+ if(hasClass) {
+ } else {
+ $li.addClass("active");
+ }
+ });
+ }($);
// sort
$(".th-sortable").click(function() {
@@ -566,4 +601,4 @@ function goNowToDatetime(goNow) {
});
-}(window.jQuery);
\ No newline at end of file
+}(window.jQuery);
From 8f8451cdffb91f3fb14adf529e8edb0b4b2bef95 Mon Sep 17 00:00:00 2001
From: ZhuangEr
Date: Mon, 31 Aug 2015 14:15:52 -0400
Subject: [PATCH 4/4] fix iss183
---
{app/test => tests}/TestNoteService.go | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename {app/test => tests}/TestNoteService.go (100%)
diff --git a/app/test/TestNoteService.go b/tests/TestNoteService.go
similarity index 100%
rename from app/test/TestNoteService.go
rename to tests/TestNoteService.go