Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix link behaviour #1407

Merged
merged 3 commits into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Application.cfc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
component {
this.name = "luceeDocumentationBuilder-" & Hash( GetCurrentTemplatePath() );

variables.assetBundleVersion = 35; // must match lucee-docs\builders\html\assets\Gruntfile.js _version
variables.assetBundleVersion = 36; // must match lucee-docs\builders\html\assets\Gruntfile.js _version

this.cwd = GetDirectoryFromPath( GetCurrentTemplatePath() )

Expand Down
2 changes: 1 addition & 1 deletion builders/html/assets/Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module.exports = function(grunt) {
grunt.registerTask( 'default', [ 'concat:base', 'uglify:base', 'sass:base', 'sassUnicode:base', 'cssmin:base', 'copy:base'] );


var _version = 35; // update in Application.cfc(s) too assetBundleVersion
var _version = 36; // update in Application.cfc(s) too assetBundleVersion

// grunt config
grunt.initConfig({
Expand Down
1,260 changes: 1,260 additions & 0 deletions builders/html/assets/css/base.36.min.css

Large diffs are not rendered by default.

2,048 changes: 1,026 additions & 1,022 deletions builders/html/assets/js/base.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion builders/html/assets/js/base.js.map

Large diffs are not rendered by default.

1,936 changes: 1,936 additions & 0 deletions builders/html/assets/js/dist/base.36.min.js

Large diffs are not rendered by default.

34 changes: 19 additions & 15 deletions builders/html/assets/js/src/stats.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,27 @@ $(function(){
}, 750);
// track outbound links
$("a").click(function(){
var url = $(this).attr("href");
if (!url || url.indexOf("#") === 0)
let href = $(this).attr("href");

// ignore if no href or no length
if(!href || !href.length) return;

try {
// ignore if same hostname
if(window.location.hostname == new URL(href).hostname) return;
} catch(e){
// ignore invalid url
return;
if (url.indexOf("http") === -1){
document.location = url; // ignore local urls
} else {
try {
gtag('event', 'click', {
'event_category': 'outbound',
'event_label': url,
'transport_type': 'beacon',
'event_callback': function(){document.location = url;}
});
} catch(e){
document.location = url;
}
}

// only track outgoing links
try {
gtag('event', 'click', {
'event_category': 'outbound',
'event_label': href,
'transport_type': 'beacon'
});
} catch(e){}
});
});

Expand Down
4 changes: 2 additions & 2 deletions server/Application.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ component {
this.mappings[ "/builds" ] = this.baseDir & "builds";
this.mappings[ "/docs" ] = this.baseDir & "docs";
this.mappings[ "/listener" ] = this.baseDir;
this.assetBundleVersion = 35; // see parent application.cfc
this.assetBundleVersion = 36; // see parent application.cfc


public void function onApplicationStart() {
application.assetBundleVersion = 35;
application.assetBundleVersion = 36;
//_addChangeWatcher();
}

Expand Down