Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
moodle-block_hshcourselist
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elc
moodle-block_hshcourselist
Commits
23a046a5
Commit
23a046a5
authored
6 years ago
by
Tobias Baden
Browse files
Options
Downloads
Patches
Plain Diff
Fixed the search - ONLY USE ON root/ path.
Not the best solution, but works on moodle live system.
parent
6ffa3e85
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
amd/build/jmodule.min.js
+2
-2
2 additions, 2 deletions
amd/build/jmodule.min.js
amd/src/jmodule.js
+7
-6
7 additions, 6 deletions
amd/src/jmodule.js
with
9 additions
and
8 deletions
amd/build/jmodule.min.js
+
2
−
2
View file @
23a046a5
/*! hshcourselist 2018-01-29 */
/*! hshcourselist 2018-08-29 */
define
([
"
jquery
"
],
function
(
a
){
function
b
(){
var
a
=
document
.
location
.
toString
(),
b
=
a
.
indexOf
(
"
/
"
,
a
.
indexOf
(
"
://
"
)
+
3
),
c
=
a
.
substring
(
0
,
b
)
+
"
/
"
,
d
=
a
.
indexOf
(
"
/
"
,
a
.
indexOf
(
c
)
+
c
.
length
);
return
a
.
substring
(
0
,
d
)}
function
c
(
c
,
d
,
e
,
f
,
g
,
h
,
i
,
j
){
d
&&
(
a
(
"
#hshcourseprogress
"
).
show
(),
a
.
ajax
({
type
:
"
GET
"
,
url
:
b
()
+
"
/blocks/hshcourselist/hshcourselist.php
"
,
data
:
"
course=
"
+
c
+
"
&instanceid=
"
+
f
+
"
&sesskey=
"
+
g
+
"
&contextid=
"
+
h
+
"
&idSearching=
"
+
i
+
"
&orderbysemester=
"
+
j
,
dataType
:
"
json
"
,
success
:
function
(
c
){
var
d
=
JSON
.
stringify
(
c
),
f
=
JSON
.
parse
(
d
),
g
=
a
(
"
<ul class='list-group' id='hshcourselistul'></ul>
"
);
f
.
length
>
0
&&
a
.
each
(
f
,
function
(
c
,
d
){
switch
(
e
){
case
"
0
"
:
displaystr
=
d
.
shortname
;
break
;
case
"
1
"
:
displaystr
=
d
.
fullname
;
break
;
case
"
2
"
:
displaystr
=
d
.
shortname
+
"
:
"
+
d
.
fullname
;
break
;
default
:
displaystr
=
d
.
fullname
}
a
(
'
<li class="list-group-item hshcoursesearchlistitem " value="
'
+
d
.
id
+
'
"><a href="
'
+
b
()
+
"
/course/view.php?id=
"
+
d
.
id
+
'
">
'
+
displaystr
+
"
</a> </li>
"
).
appendTo
(
g
)}),
a
(
"
#hshcourselistul
"
).
replaceWith
(
g
),
a
(
"
#hshcourseprogress
"
).
hide
()},
error
:
function
(){
console
.
error
(
"
error
"
),
"
abort
"
!==
o
.
statusText
&&
(
a
(
"
#hshcourseprogress
"
).
hide
(),
void
0
!==
o
.
statusText
&&
console
.
error
(
"
ABORT + STATUS :
"
+
o
.
statusText
))}}))}
return
{
init
:
function
(
b
){
var
d
,
b
=
b
,
e
=
b
.
instanceid
,
f
=
b
.
sesskey
,
g
=
b
.
displaymode
,
h
=
b
.
contextid
,
i
=!
1
,
j
=!
1
,
k
=
b
.
orderbysemester
;
a
(
"
#hshcourseprogress
"
).
hide
(),
a
(
"
.idSarchingLabel
"
).
hide
(),
a
(
"
#orderbysemestercheckbox_id
"
).
on
(
"
change
"
,
function
(){
k
=
document
.
getElementById
(
"
orderbysemestercheckbox_id
"
).
checked
,
i
=!
0
,
d
=
document
.
getElementById
(
"
hshcourselistsearch
"
).
value
,
"
#
"
===
d
.
slice
(
0
,
1
)?(
a
(
"
.idSarchingLabel
"
).
show
(),
j
=!
0
,
d
=
d
.
slice
(
1
)):(
a
(
"
.idSarchingLabel
"
).
hide
(),
j
=!
1
),
c
(
d
,
i
,
g
,
e
,
f
,
h
,
j
,
k
)}),
a
(
"
#hshcourselistsearch
"
).
on
(
"
keyup
"
,
function
(
b
){
var
l
=
b
.
keyCode
;
k
=
document
.
getElementById
(
"
orderbysemestercheckbox_id
"
).
checked
,
40
!==
l
&&
38
!==
l
&&
13
!==
l
&&
(
i
=!
0
,
d
=
document
.
getElementById
(
"
hshcourselistsearch
"
).
value
,
"
#
"
===
d
.
slice
(
0
,
1
)?(
a
(
"
.idSarchingLabel
"
).
show
(),
j
=!
0
,
d
=
d
.
slice
(
1
)):(
a
(
"
.idSarchingLabel
"
).
hide
(),
j
=!
1
),
c
(
d
,
i
,
g
,
e
,
f
,
h
,
j
,
k
))}),
a
(
"
#hshcourseform
"
).
on
(
"
submit
"
,
function
(
a
){
a
.
preventDefault
,
i
=!
0
,
j
=!
1
,
k
=
document
.
getElementById
(
"
orderbysemestercheckbox_id
"
).
checked
,
d
=
document
.
getElementById
(
"
hshcourselistsearch
"
).
value
,
"
#
"
===
d
.
slice
(
0
,
1
)?(
j
=!
0
,
d
=
d
.
slice
(
1
)):
j
=!
1
,
c
(
d
,
i
,
g
,
e
,
f
,
h
,
j
,
k
)})}}});
define
([
"
jquery
"
],
function
(
a
){
function
b
(){
var
a
=
document
.
location
.
toString
(),
b
=
a
.
indexOf
(
"
/
"
,
a
.
indexOf
(
"
://
"
)
+
3
);
return
a
.
substring
(
0
,
b
)
+
"
/
"
}
function
c
(
c
,
d
,
e
,
f
,
g
,
h
,
i
,
j
){
d
&&
(
a
(
"
#hshcourseprogress
"
).
show
(),
a
.
ajax
({
type
:
"
GET
"
,
url
:
b
()
+
"
/blocks/hshcourselist/hshcourselist.php
"
,
data
:
"
course=
"
+
c
+
"
&instanceid=
"
+
f
+
"
&sesskey=
"
+
g
+
"
&contextid=
"
+
h
+
"
&idSearching=
"
+
i
+
"
&orderbysemester=
"
+
j
,
dataType
:
"
json
"
,
success
:
function
(
c
){
var
d
=
JSON
.
stringify
(
c
),
f
=
JSON
.
parse
(
d
),
g
=
a
(
"
<ul class='list-group' id='hshcourselistul'></ul>
"
);
f
.
length
>
0
&&
a
.
each
(
f
,
function
(
c
,
d
){
switch
(
e
){
case
"
0
"
:
displaystr
=
d
.
shortname
;
break
;
case
"
1
"
:
displaystr
=
d
.
fullname
;
break
;
case
"
2
"
:
displaystr
=
d
.
shortname
+
"
:
"
+
d
.
fullname
;
break
;
default
:
displaystr
=
d
.
fullname
}
a
(
'
<li class="list-group-item hshcoursesearchlistitem " value="
'
+
d
.
id
+
'
"><a href="
'
+
b
()
+
"
/course/view.php?id=
"
+
d
.
id
+
'
">
'
+
displaystr
+
"
</a> </li>
"
).
appendTo
(
g
)}),
a
(
"
#hshcourselistul
"
).
replaceWith
(
g
),
a
(
"
#hshcourseprogress
"
).
hide
()},
error
:
function
(){
console
.
error
(
"
error
"
),
"
abort
"
!==
o
.
statusText
&&
(
a
(
"
#hshcourseprogress
"
).
hide
(),
void
0
!==
o
.
statusText
&&
console
.
error
(
"
ABORT + STATUS :
"
+
o
.
statusText
))}}))}
return
{
init
:
function
(
b
){
var
d
,
b
=
b
,
e
=
b
.
instanceid
,
f
=
b
.
sesskey
,
g
=
b
.
displaymode
,
h
=
b
.
contextid
,
i
=!
1
,
j
=!
1
,
k
=
b
.
orderbysemester
;
a
(
"
#hshcourseprogress
"
).
hide
(),
a
(
"
.idSarchingLabel
"
).
hide
(),
a
(
"
#orderbysemestercheckbox_id
"
).
on
(
"
change
"
,
function
(){
k
=
document
.
getElementById
(
"
orderbysemestercheckbox_id
"
).
checked
,
i
=!
0
,
d
=
document
.
getElementById
(
"
hshcourselistsearch
"
).
value
,
"
#
"
===
d
.
slice
(
0
,
1
)?(
a
(
"
.idSarchingLabel
"
).
show
(),
j
=!
0
,
d
=
d
.
slice
(
1
)):(
a
(
"
.idSarchingLabel
"
).
hide
(),
j
=!
1
),
c
(
d
,
i
,
g
,
e
,
f
,
h
,
j
,
k
)}),
a
(
"
#hshcourselistsearch
"
).
on
(
"
keyup
"
,
function
(
b
){
var
l
=
b
.
keyCode
;
k
=
document
.
getElementById
(
"
orderbysemestercheckbox_id
"
).
checked
,
40
!==
l
&&
38
!==
l
&&
13
!==
l
&&
(
i
=!
0
,
d
=
document
.
getElementById
(
"
hshcourselistsearch
"
).
value
,
"
#
"
===
d
.
slice
(
0
,
1
)?(
a
(
"
.idSarchingLabel
"
).
show
(),
j
=!
0
,
d
=
d
.
slice
(
1
)):(
a
(
"
.idSarchingLabel
"
).
hide
(),
j
=!
1
),
c
(
d
,
i
,
g
,
e
,
f
,
h
,
j
,
k
))}),
a
(
"
#hshcourseform
"
).
on
(
"
submit
"
,
function
(
a
){
a
.
preventDefault
,
i
=!
0
,
j
=!
1
,
k
=
document
.
getElementById
(
"
orderbysemestercheckbox_id
"
).
checked
,
d
=
document
.
getElementById
(
"
hshcourselistsearch
"
).
value
,
"
#
"
===
d
.
slice
(
0
,
1
)?(
j
=!
0
,
d
=
d
.
slice
(
1
)):
j
=!
1
,
c
(
d
,
i
,
g
,
e
,
f
,
h
,
j
,
k
)})}}});
\ No newline at end of file
\ No newline at end of file
This diff is collapsed.
Click to expand it.
amd/src/jmodule.js
+
7
−
6
View file @
23a046a5
...
@@ -3,9 +3,10 @@ define(['jquery'], function ($) {
...
@@ -3,9 +3,10 @@ define(['jquery'], function ($) {
var
_location
=
document
.
location
.
toString
();
var
_location
=
document
.
location
.
toString
();
var
applicationNameIndex
=
_location
.
indexOf
(
'
/
'
,
_location
.
indexOf
(
'
://
'
)
+
3
);
var
applicationNameIndex
=
_location
.
indexOf
(
'
/
'
,
_location
.
indexOf
(
'
://
'
)
+
3
);
var
applicationName
=
_location
.
substring
(
0
,
applicationNameIndex
)
+
'
/
'
;
var
applicationName
=
_location
.
substring
(
0
,
applicationNameIndex
)
+
'
/
'
;
var
webFolderIndex
=
_location
.
indexOf
(
'
/
'
,
_location
.
indexOf
(
applicationName
)
+
applicationName
.
length
);
return
applicationName
;
var
webFolderFullPath
=
_location
.
substring
(
0
,
webFolderIndex
);
//var webFolderIndex = _location.indexOf('/', _location.indexOf(applicationName) + applicationName.length);
return
webFolderFullPath
;
//var webFolderFullPath = _location.substring(0, webFolderIndex);
//return webFolderFullPath;
}
}
function
search
(
searchstring
,
reloadBool
,
displaymode
,
instanceid
,
sesskey
,
contextid
,
idSearching
,
orderbysemester
)
{
function
search
(
searchstring
,
reloadBool
,
displaymode
,
instanceid
,
sesskey
,
contextid
,
idSearching
,
orderbysemester
)
{
...
...
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