Skip to content

Commit

Permalink
Merge pull request #1407 from k-ave/fix-link-behaviour
Browse files Browse the repository at this point in the history
fix link behaviour
  • Loading branch information
zspitzer authored Sep 20, 2023
2 parents 45f724b + 0e6457a commit 0a7476f
Show file tree
Hide file tree
Showing 8 changed files with 4,246 additions and 1,042 deletions.
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

0 comments on commit 0a7476f

Please sign in to comment.