Page tree

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

 

From your idea to realization on your Confluence server in nearly no time. Make adjustments to the user interface a no-event!


The Idea!

We want to remove the create button that creates a new blank page.

Current Situation

The split button in the Confluence menu:

  1. Click left to create an empty page (based on no template)
  2. Click right to open the page wizard selection dialog

The shortcut 'c' clicks the left button, creating a new blank document.

Desired Situation

We would like to make it easier for users to create a new page based on a template.

Therefore we remove the left button and replace the label of the right.

When the user hits the shortcut 'c'. the page wizard selection dialog opens.

The Script

The script implements the solution:

create-with-template.js
"use strict";
 
AJS.toInit(function () {
  const $quickCreateButton = AJS.$('#quick-create-page-button');
  if ($quickCreateButton.length) {
    $quickCreateButton.hide();
    const $createButton = AJS.$('#create-page-button');
    if ($createButton.length) {
      $createButton.text("Create ...");
 
      $(document).on('keydown', null, 'c', function () {
        $createButton.click();
      });
    }
  }
});
The Deployment

The way to production:

  1. Open the Userscript Admin Tool
  2. Click submit and all users in the authors group enjoy the new create button!
It's in Use!

Packed up and ready to go ..



  • No labels