Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jquery_loadinganimation
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
jquery_loadinganimation
Commits
c2c8c4bb
Commit
c2c8c4bb
authored
13 years ago
by
Julian Pustkuchen
Browse files
Options
Downloads
Patches
Plain Diff
Added further admin options.
parent
451d5afe
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
jquery_loadinganimation.install
+4
-0
4 additions, 0 deletions
jquery_loadinganimation.install
jquery_loadinganimation.js
+37
-33
37 additions, 33 deletions
jquery_loadinganimation.js
jquery_loadinganimation.module
+2
-0
2 additions, 0 deletions
jquery_loadinganimation.module
with
43 additions
and
33 deletions
jquery_loadinganimation.install
+
4
−
0
View file @
c2c8c4bb
...
...
@@ -11,6 +11,8 @@
function
jquery_loadinganimation_install
()
{
// Set general settings.
variable_set
(
'jquery_loadinganimation_show_on_ajax'
,
TRUE
);
variable_set
(
'jquery_loadinganimation_show_on_href'
,
TRUE
);
variable_set
(
'jquery_loadinganimation_show_on_form_submit'
,
TRUE
);
}
/**
...
...
@@ -20,5 +22,7 @@ function jquery_loadinganimation_uninstall() {
// Remove the general settings.
variable_del
(
'jquery_loadinganimation_img_src'
);
variable_del
(
'jquery_loadinganimation_show_on_ajax'
);
variable_del
(
'jquery_loadinganimation_show_on_href'
);
variable_del
(
'jquery_loadinganimation_show_on_form_submit'
);
variable_del
(
'jquery_loadinganimation_subselector'
);
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
jquery_loadinganimation.js
+
37
−
33
View file @
c2c8c4bb
...
...
@@ -12,42 +12,46 @@
}
else
{
var
subselectorSuffix
=
''
;
}
$
(
context
).
find
(
"
a[href]
"
+
settings
.
subselector
).
not
(
"
a[href=javascript:;]
"
).
not
(
"
a[href=#]
"
).
not
(
"
.noLoadingAnimation
"
).
each
(
function
(
i
,
element
)
{
// Nur Elemente, die keine JS-Events haben (TODO: Nur
// click-events beachten)
if
(
typeof
$
(
element
).
data
(
"
events
"
)
==
'
undefined
'
||
$
(
element
).
data
(
"
events
"
).
length
==
0
)
{
$
(
element
).
click
(
function
(
eventObject
)
{
// Nicht bei Öffnen in neuem Tab (Strg+Klick)
if
(
!
eventObject
.
ctrlKey
)
{
Loadinganimation
.
show
();
}
});
}
});
if
(
Drupal
.
settings
.
jquery_loadinganimation
.
show_on_href
)
{
$
(
context
).
find
(
"
a[href]
"
+
settings
.
subselector
).
not
(
"
a[href=javascript:;]
"
).
not
(
"
a[href=#]
"
).
not
(
"
.noLoadingAnimation
"
).
each
(
function
(
i
,
element
)
{
// Nur Elemente, die keine JS-Events haben (TODO: Nur
// click-events beachten)
if
(
typeof
$
(
element
).
data
(
"
events
"
)
==
'
undefined
'
||
$
(
element
).
data
(
"
events
"
).
length
==
0
)
{
$
(
element
).
click
(
function
(
eventObject
)
{
// Nicht bei Öffnen in neuem Tab (Strg+Klick)
if
(
!
eventObject
.
ctrlKey
)
{
Loadinganimation
.
show
();
}
});
}
});
}
// Bei Formularversand auch ausfuehren, wenn keine anderen Events
// registriert sind.
$
(
context
).
find
(
"
form
"
+
subselectorSuffix
).
submit
(
function
()
{
if
(
typeof
$
(
this
).
data
(
"
events
"
)
==
'
undefined
'
||
$
(
this
).
data
(
"
events
"
).
length
==
0
)
{
Loadinganimation
.
show
();
}
else
{
var
show
=
true
;
jQuery
.
each
(
$
(
this
).
data
(
"
events
"
),
function
(
index
,
element
){
if
(
element
.
type
!=
undefined
){
show
=
false
;
}
});
if
(
show
){
if
(
Drupal
.
settings
.
jquery_loadinganimation
.
show_on_form_submit
)
{
// Bei Formularversand auch ausfuehren, wenn keine anderen Events
// registriert sind.
$
(
context
).
find
(
"
form
"
+
subselectorSuffix
).
submit
(
function
()
{
if
(
typeof
$
(
this
).
data
(
"
events
"
)
==
'
undefined
'
||
$
(
this
).
data
(
"
events
"
).
length
==
0
)
{
Loadinganimation
.
show
();
}
else
{
var
show
=
true
;
jQuery
.
each
(
$
(
this
).
data
(
"
events
"
),
function
(
index
,
element
){
if
(
element
.
type
!=
undefined
){
show
=
false
;
}
});
if
(
show
){
Loadinganimation
.
show
();
}
}
}
});
}
);
}
// Bei Klick auf die Animation ausblenden
$
(
"
div#loadinganimation
"
).
click
(
function
()
{
...
...
This diff is collapsed.
Click to expand it.
jquery_loadinganimation.module
+
2
−
0
View file @
c2c8c4bb
...
...
@@ -52,5 +52,7 @@ function _jquery_loadinganimation_get_settings() {
'module_path'
=>
$module_path
,
'img_src'
=>
variable_get
(
'jquery_loadinganimation_img_src'
,
$module_path
.
'/images/ajax-loader.gif'
),
'show_on_ajax'
=>
variable_get
(
'jquery_loadinganimation_show_on_ajax'
,
TRUE
),
'show_on_href'
=>
variable_get
(
'jquery_loadinganimation_show_on_href'
,
TRUE
),
'show_on_form_submit'
=>
variable_get
(
'jquery_loadinganimation_show_on_form_submit'
,
TRUE
),
'subselector'
=>
variable_get
(
'jquery_loadinganimation_subselector'
,
''
));
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment