x x x
x
Only portrait mode is currently supported - please rotate your device.

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Hide If
groupconfluence-administrators, operations-admins,smith-administrators


HTML
<div id="edit-style-container"> </div>

<script>
let disableEKey = true; 
const countryAdminGroup = "operations-admins";
var adminCanEdit = false;

async function checkIfCountryAdmin () {
    let groupsRes = await jQuery.ajax({
      url: "/rest/api/user/memberof?username=" + AJS.params.remoteUser,
      type: "get",
      dataType: "json"
    }).then(res => res);
	
	groupsRes = groupsRes.results;
    console.log(groupsRes);

    for (let i = 0; i < groupsRes.length; i++) {
      let groupName = groupsRes[i].name;
      if (groupName === countryAdminGroup) {
         adminCanEdit = true;
      }
    }
	
	return true;
}

checkIfCountryAdmin().then(res => {
	if (!adminCanEdit) {
		document.getElementById("edit-style-container").innerHTML = (`<style> 
	.micropost .micropost-right .micropost-header .micropost-action-menu.show-permanent {
		display: none !important;
	}
 </style>`);
	}
});

    $(document).on("keydown", function (e) {
      // Disabled Keys are c, e, k, n, l
      disableKeys = [67, 69, 75, 76, 78];
	  console.log("keydown", e.target)
      if (disableEKey && disableKeys.includes(e.keyCode)) {
        e.preventDefault();
        return;
      }
    });
</script>



HTML
<style>
.micropost .micropost-right .micropost-header .micropost-action-menu > .aui-button:not(.active):not(:hover) {
    background: var(--secondary-color) !important;
}
/* hide empty state */
.empty-state-container.medium {
    display: none !important;
}
div#full-height-container {
  overflow-y: scroll;
}
a.copy-micropost-permalink-action {
    display: none;
}
button.aui-button.globalTimelineMoreButton {
  visibility: hidden;
}
button.aui-button.globalTimelineMoreButton:after {
  content:'Show Older Posts';
  visibility: visible;
  display: block;
  position: relative;
  background-color: white;
  padding: 5px;
  top: 2px;
}
div#rw_wrapper {
    background: transparent;
}

div#postiontoggle {
    display: none;
}
div#custom-footer {
    display: none;
}
.aui-buttons.is-hidden {
    display: none;
}

.action-group.topic-select-container {
    visibility: hidden;
    border: 0px;
}

.editor {
    margin: 20px auto;
    background: transparent;
    background-color: transparent;
}


.mb-editor-container.textarea.full-width-field {
    border: 0px;
    background: transparent;
}

.editor-content {
    width: 90%;
    background: white;
    border-radius: 0px;
    padding: 10px 10px !important;
    background-color: white;
    margin: auto;
}

.actions.is-hidden {
    border: 0px !important;
    width: 90%;
    margin: auto !important;
}

.new-posts-refresh-timeline-container {
    width: 170px;
    border-radius: 5px !important;
    margin: auto;
    font-family: var(--main-font-family);
}

a.microblog-new-posts-refresh-timeline-link {
    border-radius: 5px !important;
    margin: auto;
    color: var(--primary-font-color) !important;
    font-family: var(--main-font-family);
}

button.aui-button.aui-button-link {
    color: var(--secondary-color);
}

.aui-button.aui-button-primary[disabled] {
    color: white;
    opacity: .7;
	border-radius: 0px;
}
</style>

...