Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
11b44f2b
Commit
11b44f2b
authored
Dec 31, 2014
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changes to make requirejs optimizer complete
parent
47f226be
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
4 additions
and
137 deletions
+4
-137
src/app/components/require.config.js
+1
-2
src/app/p_app.js
+0
-131
tasks/build_task.js
+0
-1
tasks/options/copy.js
+1
-2
tasks/options/requirejs.js
+2
-1
No files found.
src/app/components/require.config.js
View file @
11b44f2b
...
...
@@ -2,10 +2,9 @@
* Bootstrap require with the needed config, then load the app.js module.
*/
require
.
config
({
baseUrl
:
'
/
public/app'
,
baseUrl
:
'public/app'
,
paths
:
{
app
:
'p_app'
,
config
:
[
'components/config'
],
settings
:
'components/settings'
,
kbn
:
'components/kbn'
,
...
...
src/app/p_app.js
deleted
100644 → 0
View file @
47f226be
/**
* main app level module
*/
define
([
'angular'
,
'jquery'
,
'lodash'
,
'require'
,
'config'
,
'bootstrap'
,
'angular-route'
,
'angular-sanitize'
,
'angular-strap'
,
'angular-dragdrop'
,
'extend-jquery'
,
'bindonce'
,
],
function
(
angular
,
$
,
_
,
appLevelRequire
,
config
)
{
"use strict"
;
var
app
=
angular
.
module
(
'grafana'
,
[]),
// we will keep a reference to each module defined before boot, so that we can
// go back and allow it to define new features later. Once we boot, this will be false
pre_boot_modules
=
[],
// these are the functions that we need to call to register different
// features if we define them after boot time
register_fns
=
{};
// This stores the grafana version number
app
.
constant
(
'grafanaVersion'
,
"@grafanaVersion@"
);
// Use this for cache busting partials
app
.
constant
(
'cacheBust'
,
"cache-bust="
+
Date
.
now
());
/**
* Tells the application to watch the module, once bootstraping has completed
* the modules controller, service, etc. functions will be overwritten to register directly
* with this application.
* @param {[type]} module [description]
* @return {[type]} [description]
*/
app
.
useModule
=
function
(
module
)
{
if
(
pre_boot_modules
)
{
pre_boot_modules
.
push
(
module
);
}
else
{
_
.
extend
(
module
,
register_fns
);
}
return
module
;
};
app
.
config
(
function
(
$locationProvider
,
$controllerProvider
,
$compileProvider
,
$filterProvider
,
$provide
)
{
$locationProvider
.
html5Mode
(
true
);
// this is how the internet told me to dynamically add modules :/
register_fns
.
controller
=
$controllerProvider
.
register
;
register_fns
.
directive
=
$compileProvider
.
directive
;
register_fns
.
factory
=
$provide
.
factory
;
register_fns
.
service
=
$provide
.
service
;
register_fns
.
filter
=
$filterProvider
.
register
;
});
var
apps_deps
=
[
'ngRoute'
,
'ngSanitize'
,
'$strap.directives'
,
'ang-drag-drop'
,
'grafana'
,
'pasvaz.bindonce'
];
var
module_types
=
[
'controllers'
,
'directives'
,
'factories'
,
'services'
,
'filters'
,
'routes'
];
_
.
each
(
module_types
,
function
(
type
)
{
var
module_name
=
'grafana.'
+
type
;
// create the module
app
.
useModule
(
angular
.
module
(
module_name
,
[]));
// push it into the apps dependencies
apps_deps
.
push
(
module_name
);
});
var
preBootRequires
=
[
'services/all'
,
'features/all'
,
'controllers/all'
,
'directives/all'
,
'filters/all'
,
'components/partials'
,
'routes/all'
,
];
_
.
each
(
config
.
plugins
.
dependencies
,
function
(
dep
)
{
preBootRequires
.
push
(
'../plugins/'
+
dep
);
});
app
.
boot
=
function
()
{
require
(
preBootRequires
,
function
()
{
// disable tool tip animation
$
.
fn
.
tooltip
.
defaults
.
animation
=
false
;
// bootstrap the app
angular
.
element
(
document
)
.
ready
(
function
()
{
angular
.
bootstrap
(
document
,
apps_deps
)
.
invoke
([
'$rootScope'
,
function
(
$rootScope
)
{
_
.
each
(
pre_boot_modules
,
function
(
module
)
{
_
.
extend
(
module
,
register_fns
);
});
pre_boot_modules
=
false
;
$rootScope
.
requireContext
=
appLevelRequire
;
$rootScope
.
require
=
function
(
deps
,
fn
)
{
var
$scope
=
this
;
$scope
.
requireContext
(
deps
,
function
()
{
var
deps
=
_
.
toArray
(
arguments
);
// Check that this is a valid scope.
if
(
$scope
.
$id
)
{
$scope
.
$apply
(
function
()
{
fn
.
apply
(
$scope
,
deps
);
});
}
});
};
}]);
});
});
};
return
app
;
});
tasks/build_task.js
View file @
11b44f2b
...
...
@@ -22,7 +22,6 @@ module.exports = function(grunt) {
'uglify:dest'
]);
grunt
.
registerTask
(
'build:grafanaVersion'
,
function
()
{
grunt
.
config
(
'string-replace.config'
,
{
files
:
{
...
...
tasks/options/copy.js
View file @
11b44f2b
...
...
@@ -8,4 +8,4 @@ module.exports = function(config) {
dest
:
'<%= tempDir %>'
}
};
};
\ No newline at end of file
};
tasks/options/requirejs.js
View file @
11b44f2b
...
...
@@ -6,9 +6,10 @@ module.exports = function(config,grunt) {
options
:
{
appDir
:
'<%= tempDir %>'
,
dir
:
'<%= destDir %>'
,
baseUrl
:
'./app'
,
mainConfigFile
:
'<%= tempDir %>/app/components/require.config.js'
,
modules
:
[],
// populated below
modules
:
[],
// populated below
,
optimize
:
'none'
,
optimizeCss
:
'none'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment