Skip to content

Commit

Permalink
Merge branch '4.0-dev' into ToggleEditor
Browse files Browse the repository at this point in the history
  • Loading branch information
HLeithner committed Feb 27, 2019
2 parents 8074f53 + 2d0376e commit a71de09
Show file tree
Hide file tree
Showing 30 changed files with 559 additions and 349 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -145,55 +145,55 @@ function jSelectCategory_" . $this->id . "(id, title, object) {
// Select category button.
if ($allowSelect)
{
$html .= '<a'
. ' class="btn btn-primary hasTooltip' . ($value ? ' sr-only' : '') . '"'
$html .= '<button'
. ' class="btn btn-primary hasTooltip' . ($value ? ' hidden' : '') . '"'
. ' id="' . $this->id . '_select"'
. ' data-toggle="modal"'
. ' role="button"'
. ' href="#ModalSelect' . $modalId . '"'
. ' type="button"'
. ' data-target="#ModalSelect' . $modalId . '"'
. ' title="' . HTMLHelper::tooltipText('COM_CATEGORIES_CHANGE_CATEGORY') . '">'
. '<span class="icon-file" aria-hidden="true"></span> ' . Text::_('JSELECT')
. '</a>';
. '</button>';
}

// New category button.
if ($allowNew)
{
$html .= '<a'
. ' class="btn btn-secondary hasTooltip' . ($value ? ' sr-only' : '') . '"'
$html .= '<button'
. ' class="btn btn-secondary hasTooltip' . ($value ? ' hidden' : '') . '"'
. ' id="' . $this->id . '_new"'
. ' data-toggle="modal"'
. ' role="button"'
. ' href="#ModalNew' . $modalId . '"'
. ' type="button"'
. ' data-target="#ModalNew' . $modalId . '"'
. ' title="' . HTMLHelper::tooltipText('COM_CATEGORIES_NEW_CATEGORY') . '">'
. '<span class="icon-new" aria-hidden="true"></span> ' . Text::_('JACTION_CREATE')
. '</a>';
. '</button>';
}

// Edit category button.
if ($allowEdit)
{
$html .= '<a'
. ' class="btn btn-secondary hasTooltip' . ($value ? '' : ' sr-only') . '"'
$html .= '<button'
. ' class="btn btn-secondary hasTooltip' . ($value ? '' : ' hidden') . '"'
. ' id="' . $this->id . '_edit"'
. ' data-toggle="modal"'
. ' role="button"'
. ' href="#ModalEdit' . $modalId . '"'
. ' type="button"'
. ' data-target="#ModalEdit' . $modalId . '"'
. ' title="' . HTMLHelper::tooltipText('COM_CATEGORIES_EDIT_CATEGORY') . '">'
. '<span class="icon-edit" aria-hidden="true"></span> ' . Text::_('JACTION_EDIT')
. '</a>';
. '</button>';
}

// Clear category button.
if ($allowClear)
{
$html .= '<a'
. ' class="btn btn-secondary' . ($value ? '' : ' sr-only') . '"'
$html .= '<button'
. ' class="btn btn-secondary' . ($value ? '' : ' hidden') . '"'
. ' id="' . $this->id . '_clear"'
. ' href="#"'
. ' type="button"'
. ' onclick="window.processModalParent(\'' . $this->id . '\'); return false;">'
. '<span class="icon-remove" aria-hidden="true"></span>' . Text::_('JCLEAR')
. '</a>';
. '</button>';
}

if ($allowSelect || $allowNew || $allowEdit || $allowClear)
Expand Down
38 changes: 19 additions & 19 deletions administrator/components/com_contact/Field/Modal/ContactField.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,55 +134,55 @@ function jSelectContact_" . $this->id . "(id, title, object) {
// Select contact button
if ($allowSelect)
{
$html .= '<a'
. ' class="btn btn-primary hasTooltip' . ($value ? ' sr-only' : '') . '"'
$html .= '<button'
. ' class="btn btn-primary hasTooltip' . ($value ? ' hidden' : '') . '"'
. ' id="' . $this->id . '_select"'
. ' data-toggle="modal"'
. ' role="button"'
. ' href="#ModalSelect' . $modalId . '"'
. ' type="button"'
. ' data-target="#ModalSelect' . $modalId . '"'
. ' title="' . HTMLHelper::tooltipText('COM_CONTACT_CHANGE_CONTACT') . '">'
. '<span class="icon-file" aria-hidden="true"></span> ' . Text::_('JSELECT')
. '</a>';
. '</button>';
}

// New contact button
if ($allowNew)
{
$html .= '<a'
. ' class="btn btn-secondary hasTooltip' . ($value ? ' sr-only' : '') . '"'
$html .= '<button'
. ' class="btn btn-secondary hasTooltip' . ($value ? ' hidden' : '') . '"'
. ' id="' . $this->id . '_new"'
. ' data-toggle="modal"'
. ' role="button"'
. ' href="#ModalNew' . $modalId . '"'
. ' type="button"'
. ' data-target="#ModalNew' . $modalId . '"'
. ' title="' . HTMLHelper::tooltipText('COM_CONTACT_NEW_CONTACT') . '">'
. '<span class="icon-new" aria-hidden="true"></span> ' . Text::_('JACTION_CREATE')
. '</a>';
. '</button>';
}

// Edit contact button
if ($allowEdit)
{
$html .= '<a'
. ' class="btn btn-secondary hasTooltip' . ($value ? '' : ' sr-only') . '"'
$html .= '<button'
. ' class="btn btn-secondary hasTooltip' . ($value ? '' : ' hidden') . '"'
. ' id="' . $this->id . '_edit"'
. ' data-toggle="modal"'
. ' role="button"'
. ' href="#ModalEdit' . $modalId . '"'
. ' type="button"'
. ' data-target="#ModalEdit' . $modalId . '"'
. ' title="' . HTMLHelper::tooltipText('COM_CONTACT_EDIT_CONTACT') . '">'
. '<span class="icon-edit" aria-hidden="true"></span> ' . Text::_('JACTION_EDIT')
. '</a>';
. '</button>';
}

// Clear contact button
if ($allowClear)
{
$html .= '<a'
. ' class="btn btn-secondary' . ($value ? '' : ' sr-only') . '"'
$html .= '<button'
. ' class="btn btn-secondary' . ($value ? '' : ' hidden') . '"'
. ' id="' . $this->id . '_clear"'
. ' href="#"'
. ' type="button"'
. ' onclick="window.processModalParent(\'' . $this->id . '\'); return false;">'
. '<span class="icon-remove" aria-hidden="true"></span>' . Text::_('JCLEAR')
. '</a>';
. '</button>';
}

if ($allowSelect || $allowNew || $allowEdit || $allowClear)
Expand Down
38 changes: 19 additions & 19 deletions administrator/components/com_content/Field/Modal/ArticleField.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,55 +137,55 @@ function jSelectArticle_" . $this->id . "(id, title, catid, object, url, languag
// Select article button
if ($allowSelect)
{
$html .= '<a'
. ' class="btn btn-primary hasTooltip' . ($value ? ' sr-only' : '') . '"'
$html .= '<button'
. ' class="btn btn-primary hasTooltip' . ($value ? ' hidden' : '') . '"'
. ' id="' . $this->id . '_select"'
. ' data-toggle="modal"'
. ' role="button"'
. ' href="#ModalSelect' . $modalId . '"'
. ' type="button"'
. ' data-target="#ModalSelect' . $modalId . '"'
. ' title="' . HTMLHelper::tooltipText('COM_CONTENT_CHANGE_ARTICLE') . '">'
. '<span class="icon-file" aria-hidden="true"></span> ' . Text::_('JSELECT')
. '</a>';
. '</button>';
}

// New article button
if ($allowNew)
{
$html .= '<a'
. ' class="btn btn-secondary hasTooltip' . ($value ? ' sr-only' : '') . '"'
$html .= '<button'
. ' class="btn btn-secondary hasTooltip' . ($value ? ' hidden' : '') . '"'
. ' id="' . $this->id . '_new"'
. ' data-toggle="modal"'
. ' role="button"'
. ' href="#ModalNew' . $modalId . '"'
. ' type="button"'
. ' data-target="#ModalNew' . $modalId . '"'
. ' title="' . HTMLHelper::tooltipText('COM_CONTENT_NEW_ARTICLE') . '">'
. '<span class="icon-new" aria-hidden="true"></span> ' . Text::_('JACTION_CREATE')
. '</a>';
. '</button>';
}

// Edit article button
if ($allowEdit)
{
$html .= '<a'
. ' class="btn btn-secondary hasTooltip' . ($value ? '' : ' sr-only') . '"'
$html .= '<button'
. ' class="btn btn-secondary hasTooltip' . ($value ? '' : ' hidden') . '"'
. ' id="' . $this->id . '_edit"'
. ' data-toggle="modal"'
. ' role="button"'
. ' href="#ModalEdit' . $modalId . '"'
. ' type="button"'
. ' data-target="#ModalEdit' . $modalId . '"'
. ' title="' . HTMLHelper::tooltipText('COM_CONTENT_EDIT_ARTICLE') . '">'
. '<span class="icon-edit" aria-hidden="true"></span> ' . Text::_('JACTION_EDIT')
. '</a>';
. '</button>';
}

// Clear article button
if ($allowClear)
{
$html .= '<a'
. ' class="btn btn-secondary' . ($value ? '' : ' sr-only') . '"'
$html .= '<button'
. ' class="btn btn-secondary' . ($value ? '' : ' hidden') . '"'
. ' id="' . $this->id . '_clear"'
. ' href="#"'
. ' type="button"'
. ' onclick="window.processModalParent(\'' . $this->id . '\'); return false;">'
. '<span class="icon-remove" aria-hidden="true"></span>' . Text::_('JCLEAR')
. '</a>';
. '</button>';
}

if ($allowSelect || $allowNew || $allowEdit || $allowClear)
Expand Down
2 changes: 1 addition & 1 deletion administrator/components/com_content/Service/HTML/Icon.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,6 @@ public function print_screen($params, $legacy = false)
{
$text = LayoutHelper::render('joomla.content.icons.print_screen', array('params' => $params, 'legacy' => $legacy));

return '<a href="#" onclick="window.print();return false;">' . $text . '</a>';
return '<button type="button" onclick="window.print();return false;">' . $text . '</button>';
}
}
4 changes: 2 additions & 2 deletions administrator/components/com_media/layouts/toolbar/delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@

$title = Text::_('JTOOLBAR_DELETE');
?>
<button class="btn btn-sm btn-danger" onclick="MediaManager.Event.fire('onClickDelete');">
<button id="mediaDelete" class="btn btn-sm btn-danger" onclick="MediaManager.Event.fire('onClickDelete');">
<span class="icon-delete" title="<?php echo $title; ?>"></span> <?php echo $title; ?>
</button>
</button>
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
?>
<button class="btn btn-sm btn-success" onclick="MediaManager.Event.fire('onClickUpload');">
<span class="icon-upload" title="<?php echo $title; ?>"></span> <?php echo $title; ?>
</button>
</button>
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class Api {
data: JSON.stringify(data),
headers: {'Content-Type': 'application/json'},
onSuccess: (response) => {
notifications.success('COM_MEDIA_UPDLOAD_SUCCESS');
notifications.success('COM_MEDIA_UPLOAD_SUCCESS');
resolve(this._normalizeItem(JSON.parse(response).data))
},
onError: (xhr) => {
Expand All @@ -138,7 +138,7 @@ class Api {
/**
* Rename an item
* @param path
* @param newName
* @param newPath
* @return {Promise.<T>}
*/
rename(path, newPath) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

<script>
import * as types from "./../store/mutation-types";
import Api from "./../app/Api";
import {notifications} from "./../app/Notifications";
export default {
name: 'media-app',
Expand All @@ -45,7 +45,13 @@
created() {
// Listen to the toolbar events
MediaManager.Event.listen('onClickCreateFolder', () => this.$store.commit(types.SHOW_CREATE_FOLDER_MODAL));
MediaManager.Event.listen('onClickDelete', () => this.$store.dispatch('deleteSelectedItems'));
MediaManager.Event.listen('onClickDelete', () => {
if (this.$store.state.selectedItems.length > 0) {
this.$store.commit(types.SHOW_CONFIRM_DELETE_MODAL);
} else {
notifications.error('COM_MEDIA_PLEASE_SELECT_ITEM');
}
});
},
mounted() {
// Set the full height and add event listener when dom is updated
Expand All @@ -63,4 +69,4 @@
window.removeEventListener('resize', this.setFullHeight)
},
}
</script>
</script>
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<template>
<ol class="media-breadcrumb">
<li class="media-breadcrumb-item" v-for="crumb in crumbs">
<a @click.stop.prevent="onCrumbClick(crumb)">{{ crumb.name }}</a>
</li>
</ol>
<nav class="media-breadcrumb" role="navigation" :aria-label="translate('COM_MEDIA_BREADCRUMB_LABEL')">
<ol>
<li class="media-breadcrumb-item" v-for="(val,index) in crumbs">
<a href="#" @click.stop.prevent="onCrumbClick(val)" v-bind:aria-current="(index === Object.keys(crumbs).length - 1) ? 'page' : undefined">{{ val.name }}</a>
</li>
</ol>
</nav>
</template>

<script>
Expand Down Expand Up @@ -62,7 +64,7 @@
});
return driveObject;
}
},
},
}
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,10 @@
methods: {
/* Unselect all browser items */
unselectAllBrowserItems(event) {
const clickedDelete = (event.target.id !== undefined && event.target.id === 'mediaDelete') ? true : false;
const notClickedBrowserItems = (this.$refs.browserItems && !this.$refs.browserItems.contains(event.target)) || event.target === this.$refs.browserItems;
const notClickedInfobar = this.$refs.infobar !== undefined && !this.$refs.infobar.$el.contains(event.target);
const clickedOutside = notClickedBrowserItems && notClickedInfobar;
const clickedOutside = notClickedBrowserItems && notClickedInfobar && !clickedDelete;
if (clickedOutside) {
this.$store.commit(types.UNSELECT_ALL_BROWSER_ITEMS);
}
Expand Down

0 comments on commit a71de09

Please sign in to comment.