Member Avatar for diafol

Thought I'd share a shortcut with you. You've probably seen Tampermonkey (or Greasemonkey) before. This one adds my favourite shortcuts to the DW nav:

Capture.PNG

Here's the easy script:

 // ==UserScript==
// @name     DIAFOL_BAR
// @include  https://www.daniweb.com/*
// @require  http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
// @grant    GM_addStyle
// ==/UserScript==
$("nav .navbar-nav").append ( '<li><a href="/programming/web-development/6">WP</a></li><li><a href="/community-center/3">CC</a></li>');

I get "404 not found" when I click on the attachment. And, never having used Tampermonkey or Greasemonkey, what advantage does the script have over putting a link on my bookmark bar?

Member Avatar for diafol

Hi RJ - I think there's a problem with the upload image feature - hence 404.

The advantage is:

No need to clutter up your general browser bookmarks bar when you're not on Daniweb. It appears in the Daniweb bar alongside user | finder | inbox. Going to the blue hamburger button is not intuitive on my desktop - even after all these months.

CaptureDW.PNG

Yeah, sorry about that, there was a bug where the "insert image into post" link was linking to the wrong path.

Thought I'd share a shortcut with you. You've probably seen Tampermonkey (or Greasemonkey) before. This one adds my favourite shortcuts to the DW nav:

Very cool. I will admit that I am a complete noob on this stuff. In fact, I am not even a noob since "noob" imples that I have attempted to do something similar at least once. I have not, so I would be a "pre-noob". However, I am always interested in learning interesting new things and your script seems like an easy copy/paste thing to try and I would like to try.

As a pre-noob, however, I am so new to this that I do not even know what I am supposed to do with your script. I'm supposed to copy and paste your script where? Do I need to do something with Tampermonkey, which I had never heard of before this thread?

Not trying to avoid putting in effort mind you. My case is the equivalent of my mom seeing a C++ "Hello World" program and not knowing enough about C++ to know that in order to make the "Hello World" code work, she would need to know to install an "IDE" and "compile" it first, both being terms that she is unfamiliar with. Is this a ten second copy/paste, then I can reproduce the image you posted, or do I need to set aside several hours to learn about Tampermonkey first?

Member Avatar for diafol

Ah. If using Chrome as your browser, you can install Tampermonkey as a plugin extension. Then just right click onto options and add a new userscript. Paste the code above into place and save. Then you should be good to go. If the attachment service was working, I'd post a visual walkthrough :)

commented: Good stuff +0

If the attachment service was working, I'd post a visual walkthrough :)

Attachments are working! ;) Private message attachments coming soon. And by "soon" I mean I have a few other things to take care of first.

commented: Thanks Dani +0

Worked great. Visual walkthrough unnecessary. Changed line 7 to add Programming forum. Easy. Thanks.

If using Chrome as your browser, you can install Tampermonkey as a plugin extension.

It works also with the CJS (Custom JavaScript extension). Thank you for sharing, it's great! :)

Member Avatar for diafol

CJS new to me - will give it a look :)

Member Avatar for diafol

cjs works beautifully - seems a lot easier than Tampermonkey!
Got it to work with just:

$("nav .navbar-nav").append ( '<li><a href="/programming/web-development/6">WP</a></li><li><a href="/community-center/3">CC</a></li>');

No need for any commented settings, just choosing inclusions from dropdowns. Very neat.

Captureme.PNG

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.