Parcourir la Source

fixed some jquery madness (my fault)

bmallred 10 ans auparavant
Parent
Commettre
79c2f1bad9
4 fichiers modifiés avec 70 ajouts et 60 suppressions
  1. 29 29
      app/routes/routes.go
  2. 26 26
      app/tmp/main.go
  3. 1 1
      conf/app.conf
  4. 14 4
      public/js/grassfed.js

+ 29 - 29
app/routes/routes.go

30
}
30
}
31
31
32
32
33
type tStatic struct {}
34
var Static tStatic
35
36
37
func (_ tStatic) Serve(
38
		prefix string,
39
		filepath string,
40
		) string {
41
	args := make(map[string]string)
42
	
43
	revel.Unbind(args, "prefix", prefix)
44
	revel.Unbind(args, "filepath", filepath)
45
	return revel.MainRouter.Reverse("Static.Serve", args).Url
46
}
47
48
func (_ tStatic) ServeModule(
49
		moduleName string,
50
		prefix string,
51
		filepath string,
52
		) string {
53
	args := make(map[string]string)
54
	
55
	revel.Unbind(args, "moduleName", moduleName)
56
	revel.Unbind(args, "prefix", prefix)
57
	revel.Unbind(args, "filepath", filepath)
58
	return revel.MainRouter.Reverse("Static.ServeModule", args).Url
59
}
60
61
33
type tTestRunner struct {}
62
type tTestRunner struct {}
34
var TestRunner tTestRunner
63
var TestRunner tTestRunner
35
64
60
}
89
}
61
90
62
91
63
type tStatic struct {}
64
var Static tStatic
65
66
67
func (_ tStatic) Serve(
68
		prefix string,
69
		filepath string,
70
		) string {
71
	args := make(map[string]string)
72
	
73
	revel.Unbind(args, "prefix", prefix)
74
	revel.Unbind(args, "filepath", filepath)
75
	return revel.MainRouter.Reverse("Static.Serve", args).Url
76
}
77
78
func (_ tStatic) ServeModule(
79
		moduleName string,
80
		prefix string,
81
		filepath string,
82
		) string {
83
	args := make(map[string]string)
84
	
85
	revel.Unbind(args, "moduleName", moduleName)
86
	revel.Unbind(args, "prefix", prefix)
87
	revel.Unbind(args, "filepath", filepath)
88
	return revel.MainRouter.Reverse("Static.ServeModule", args).Url
89
}
90
91
92
type tApplication struct {}
92
type tApplication struct {}
93
var Application tApplication
93
var Application tApplication
94
94

+ 26 - 26
app/tmp/main.go

6
	"reflect"
6
	"reflect"
7
	"github.com/revel/revel"
7
	"github.com/revel/revel"
8
	_ "github.com/mattn/go-sqlite3"
8
	_ "github.com/mattn/go-sqlite3"
9
	controllers1 "github.com/revel/revel/modules/static/app/controllers"
9
	controllers0 "github.com/revel/revel/modules/static/app/controllers"
10
	_ "github.com/revel/revel/modules/testrunner/app"
10
	_ "github.com/revel/revel/modules/testrunner/app"
11
	controllers0 "github.com/revel/revel/modules/testrunner/app/controllers"
11
	controllers1 "github.com/revel/revel/modules/testrunner/app/controllers"
12
	_ "github.com/revolvingcow/grassfed/app"
12
	_ "github.com/revolvingcow/grassfed/app"
13
	controllers "github.com/revolvingcow/grassfed/app/controllers"
13
	controllers "github.com/revolvingcow/grassfed/app/controllers"
14
	tests "github.com/revolvingcow/grassfed/tests"
14
	tests "github.com/revolvingcow/grassfed/tests"
55
			
55
			
56
		})
56
		})
57
	
57
	
58
	revel.RegisterController((*controllers0.TestRunner)(nil),
58
	revel.RegisterController((*controllers0.Static)(nil),
59
		[]*revel.MethodType{
59
		[]*revel.MethodType{
60
			&revel.MethodType{
60
			&revel.MethodType{
61
				Name: "Index",
61
				Name: "Serve",
62
				Args: []*revel.MethodArg{ 
62
				Args: []*revel.MethodArg{ 
63
					&revel.MethodArg{Name: "prefix", Type: reflect.TypeOf((*string)(nil)) },
64
					&revel.MethodArg{Name: "filepath", Type: reflect.TypeOf((*string)(nil)) },
63
				},
65
				},
64
				RenderArgNames: map[int][]string{ 
66
				RenderArgNames: map[int][]string{ 
65
					46: []string{ 
66
						"testSuites",
67
					},
68
				},
67
				},
69
			},
68
			},
70
			&revel.MethodType{
69
			&revel.MethodType{
71
				Name: "Run",
70
				Name: "ServeModule",
72
				Args: []*revel.MethodArg{ 
71
				Args: []*revel.MethodArg{ 
73
					&revel.MethodArg{Name: "suite", Type: reflect.TypeOf((*string)(nil)) },
74
					&revel.MethodArg{Name: "test", Type: reflect.TypeOf((*string)(nil)) },
72
					&revel.MethodArg{Name: "moduleName", Type: reflect.TypeOf((*string)(nil)) },
73
					&revel.MethodArg{Name: "prefix", Type: reflect.TypeOf((*string)(nil)) },
74
					&revel.MethodArg{Name: "filepath", Type: reflect.TypeOf((*string)(nil)) },
75
				},
75
				},
76
				RenderArgNames: map[int][]string{ 
76
				RenderArgNames: map[int][]string{ 
77
					69: []string{ 
78
						"error",
79
					},
80
				},
77
				},
81
			},
78
			},
79
			
80
		})
81
	
82
	revel.RegisterController((*controllers1.TestRunner)(nil),
83
		[]*revel.MethodType{
82
			&revel.MethodType{
84
			&revel.MethodType{
83
				Name: "List",
85
				Name: "Index",
84
				Args: []*revel.MethodArg{ 
86
				Args: []*revel.MethodArg{ 
85
				},
87
				},
86
				RenderArgNames: map[int][]string{ 
88
				RenderArgNames: map[int][]string{ 
89
					46: []string{ 
90
						"testSuites",
91
					},
87
				},
92
				},
88
			},
93
			},
89
			
90
		})
91
	
92
	revel.RegisterController((*controllers1.Static)(nil),
93
		[]*revel.MethodType{
94
			&revel.MethodType{
94
			&revel.MethodType{
95
				Name: "Serve",
95
				Name: "Run",
96
				Args: []*revel.MethodArg{ 
96
				Args: []*revel.MethodArg{ 
97
					&revel.MethodArg{Name: "prefix", Type: reflect.TypeOf((*string)(nil)) },
98
					&revel.MethodArg{Name: "filepath", Type: reflect.TypeOf((*string)(nil)) },
97
					&revel.MethodArg{Name: "suite", Type: reflect.TypeOf((*string)(nil)) },
98
					&revel.MethodArg{Name: "test", Type: reflect.TypeOf((*string)(nil)) },
99
				},
99
				},
100
				RenderArgNames: map[int][]string{ 
100
				RenderArgNames: map[int][]string{ 
101
					69: []string{ 
102
						"error",
103
					},
101
				},
104
				},
102
			},
105
			},
103
			&revel.MethodType{
106
			&revel.MethodType{
104
				Name: "ServeModule",
107
				Name: "List",
105
				Args: []*revel.MethodArg{ 
108
				Args: []*revel.MethodArg{ 
106
					&revel.MethodArg{Name: "moduleName", Type: reflect.TypeOf((*string)(nil)) },
107
					&revel.MethodArg{Name: "prefix", Type: reflect.TypeOf((*string)(nil)) },
108
					&revel.MethodArg{Name: "filepath", Type: reflect.TypeOf((*string)(nil)) },
109
				},
109
				},
110
				RenderArgNames: map[int][]string{ 
110
				RenderArgNames: map[int][]string{ 
111
				},
111
				},

+ 1 - 1
conf/app.conf

1
app.name=grassfed
1
app.name=grassfed
2
app.secret=LKfEwFXUpTy6uedNSLesni6xh7nV18sVwVWvbSJWGjUusrOvB8RHxrxPap0w4QPE
2
app.secret=LKfEwFXUpTy6uedNSLesni6xh7nV18sVwVWvbSJWGjUusrOvB8RHxrxPap0w4QPE
3
http.addr=
3
http.addr=
4
http.port=9000
4
http.port=5090
5
http.ssl=false
5
http.ssl=false
6
http.sslcert=
6
http.sslcert=
7
http.sslkey=
7
http.sslkey=

+ 14 - 4
public/js/grassfed.js

1
(function ($) {
2
    $.each(['show', 'hide'], function (i, ev) {
3
        var el = $.fn[ev];
4
        $.fn[ev] = function () {
5
            this.trigger(ev);
6
            return el.apply(this, arguments);
7
        };
8
    });
9
})(jQuery);
10
1
$(function () {
11
$(function () {
2
    // Bring the authentication down slowly...
12
    // Bring the authentication down slowly...
3
    // this is in case they already have a valid sign-on.
13
    // this is in case they already have a valid sign-on.
4
    $('div#authentication').delay(1000).fadeIn();
14
    $('div#authentication').delay(1000).fadeIn();
5
15
16
    var chart = $("#goalChart")[0];
17
    var doughnutChart;
18
6
    function startEngine() {
19
    function startEngine() {
7
        var chart = $("#goalChart")[0];
8
        var doughnutChart;
9
    
10
        // Pull the information we need first.
20
        // Pull the information we need first.
11
        loadStatistics();
21
        loadStatistics();
12
        loadHistory();
22
        loadHistory();
13
    }
23
    }
14
24
15
    $(document).on('change', 'div#profile', function () {
25
    $('div#profile').on('show', function () {
16
        startEngine();
26
        startEngine();
17
    });
27
    });
18
28