Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
makura-2025
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Raj Shah
makura-2025
Commits
4ebfec1e
Commit
4ebfec1e
authored
Jul 15, 2025
by
rajshah
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: download count in resource detail v0.4
parent
d83ea70e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
26 deletions
+26
-26
script.js
assets/js/script.js
+0
-26
style.js
assets/js/style.js
+26
-0
No files found.
assets/js/script.js
View file @
4ebfec1e
...
@@ -341,28 +341,3 @@
...
@@ -341,28 +341,3 @@
})
})
})(
jQuery
);
})(
jQuery
);
// download count
jQuery
(
document
).
ready
(
function
(
$
)
{
$
(
'#btn-resource-download'
).
on
(
'click'
,
function
()
{
const
resourceId
=
$
(
this
).
data
(
'resource-id'
);
$
.
ajax
({
url
:
frontend_ajax_object
.
ajax_url
,
type
:
'POST'
,
data
:
{
action
:
'increment_download_count'
,
resource_id
:
resourceId
,
},
success
:
function
(
response
)
{
if
(
response
.
success
)
{
$
(
'#download-count'
).
text
(
response
.
new_count
);
}
else
{
console
.
log
(
response
.
message
);
}
},
error
:
function
()
{
console
.
log
(
'Error processing the request.'
);
},
});
});
});
\ No newline at end of file
assets/js/style.js
View file @
4ebfec1e
...
@@ -608,3 +608,28 @@
...
@@ -608,3 +608,28 @@
});
});
});
});
})(
jQuery
);
})(
jQuery
);
// download count
jQuery
(
document
).
ready
(
function
(
$
)
{
$
(
'#btn-resource-download'
).
on
(
'click'
,
function
()
{
const
resourceId
=
$
(
this
).
data
(
'resource-id'
);
$
.
ajax
({
url
:
frontend_ajax_object
.
ajax_url
,
type
:
"POST"
,
data
:
{
action
:
"increment_download_count"
,
resource_id
:
resourceId
,
},
success
:
function
(
response
)
{
if
(
response
.
success
)
{
$
(
"#download-count"
).
text
(
response
.
new_count
);
}
else
{
console
.
log
(
response
.
message
);
}
},
error
:
function
()
{
console
.
log
(
"Error processing the request."
);
},
});
});
});
\ No newline at end of file
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