Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
captcha-3110283
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
Issue forks
captcha-3110283
Commits
9ef5ce05
Commit
9ef5ce05
authored
14 years ago
by
soxofaan
Browse files
Options
Downloads
Patches
Plain Diff
fixed jquery magic on image CAPTCHA admin page
parent
9a14c1eb
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
image_captcha/image_captcha.js
+34
-34
34 additions, 34 deletions
image_captcha/image_captcha.js
with
34 additions
and
34 deletions
image_captcha/image_captcha.js
+
34
−
34
View file @
9ef5ce05
// $Id$
(
function
(
$
)
{
(
function
(
$
)
{
//TODO: change this to
Drupal.behaviors.captcha
a
dmin =
function (context) {}
$
(
document
).
ready
(
function
()
{
Drupal
.
behaviors
.
captcha
A
dmin
=
{
attach
:
function
(
context
)
{
// Helper function to show/hide noise level widget.
var
noise_level_shower
=
function
(
speed
)
{
speed
=
(
typeof
speed
==
'
undefined
'
)
?
'
slow
'
:
speed
;
if
(
$
(
"
#edit-image-captcha-dot-noise
"
).
is
(
"
:checked
"
)
||
$
(
"
#edit-image-captcha-line-noise
"
).
is
(
"
:checked
"
))
{
$
(
"
#edit-image-captcha-
noise-level-wrapper
"
).
show
(
speed
);
}
else
{
$
(
"
#edit
-image-captcha-noise-level
-wrapper
"
).
hide
(
speed
);
}
}
// Add onclick handler to the dot and line noise check boxes.
$
(
"
#edit-image-captcha-dot-noise
"
).
click
(
noise_level_shower
);
$
(
"
#edit-image-captcha-line-noise
"
).
click
(
noise_level_shower
);
// Show or hide appropriately on page load.
noise_level_shower
(
0
);
// Helper function to show/hide noise level widget.
var
noise_level_shower
=
function
(
speed
)
{
speed
=
(
typeof
speed
==
'
undefined
'
)
?
'
slow
'
:
speed
;
if
(
$
(
"
#edit-image-captcha-dot-noise
"
).
is
(
"
:checked
"
)
||
$
(
"
#edit-image-captcha-
line-noise
"
).
is
(
"
:checked
"
))
{
$
(
"
.form-item-image-captcha-noise-level
"
).
show
(
speed
);
}
else
{
$
(
"
.form-item
-image-captcha-noise-level
"
).
hide
(
speed
);
}
}
// Add onclick handler to the dot and line noise check boxes.
$
(
"
#edit-image-captcha-dot-noise
"
).
click
(
noise_level_shower
);
$
(
"
#edit-image-captcha-line-noise
"
).
click
(
noise_level_shower
);
// Show or hide appropriately on page load.
noise_level_shower
(
0
);
// Helper function to show/hide smooth distortion widget.
var
smooth_distortion_shower
=
function
(
speed
)
{
speed
=
(
typeof
speed
==
'
undefined
'
)
?
'
slow
'
:
speed
;
if
(
$
(
"
#edit-image-captcha-distortion-amplitude
"
).
val
()
>
0
)
{
$
(
"
#edit
-image-captcha-bilinear-interpolation
-wrapper
"
).
show
(
speed
);
}
else
{
$
(
"
#edit-image-captcha-bilinear-interpolation-wrapper
"
).
hide
(
speed
);
}
}
// Add onchange handler to the distortion level select widget.
$
(
"
#edit-image-captcha-distortion-amplitude
"
).
change
(
smooth_distortion_shower
);
// Show or hide appropriately on page load.
smooth_distortion_shower
(
0
)
// Helper function to show/hide smooth distortion widget.
var
smooth_distortion_shower
=
function
(
speed
)
{
speed
=
(
typeof
speed
==
'
undefined
'
)
?
'
slow
'
:
speed
;
if
(
$
(
"
#edit-image-captcha-distortion-amplitude
"
).
val
()
>
0
)
{
$
(
"
.form-item
-image-captcha-bilinear-interpolation
"
).
show
(
speed
);
}
else
{
$
(
"
.form-item-image-captcha-bilinear-interpolation
"
).
hide
(
speed
);
}
}
// Add onchange handler to the distortion level select widget.
$
(
"
#edit-image-captcha-distortion-amplitude
"
).
change
(
smooth_distortion_shower
);
// Show or hide appropriately on page load.
smooth_distortion_shower
(
0
)
});
}
};
})(
jQuery
);
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