diff --git a/app/javascript/gabsocial/actions/compose.js b/app/javascript/gabsocial/actions/compose.js index 620ad4ed..43c5673a 100644 --- a/app/javascript/gabsocial/actions/compose.js +++ b/app/javascript/gabsocial/actions/compose.js @@ -3,6 +3,7 @@ import { CancelToken, isCancel } from 'axios'; import { throttle } from 'lodash'; import moment from 'moment'; import { search as emojiSearch } from '../components/emoji/emoji_mart_search_light'; +import { urlRegex } from '../features/compose/util/url_regex' import { tagHistory } from '../settings'; import { useEmoji } from './emojis'; import resizeImage from '../utils/resize_image'; @@ -62,6 +63,8 @@ export const COMPOSE_POLL_SETTINGS_CHANGE = 'COMPOSE_POLL_SETTINGS_CHANGE'; export const COMPOSE_SCHEDULED_AT_CHANGE = 'COMPOSE_SCHEDULED_AT_CHANGE'; +export const COMPOSE_RICH_TEXT_EDITOR_CONTROLS_VISIBILITY = 'COMPOSE_RICH_TEXT_EDITOR_CONTROLS_VISIBILITY' + const messages = defineMessages({ uploadErrorLimit: { id: 'upload_error.limit', defaultMessage: 'File upload limit exceeded.' }, uploadErrorPoll: { id: 'upload_error.poll', defaultMessage: 'File upload not allowed with polls.' }, @@ -170,12 +173,20 @@ export function submitCompose(routerHistory, group) { return function (dispatch, getState) { if (!me) return; - const status = getState().getIn(['compose', 'text'], ''); + let status = getState().getIn(['compose', 'text'], ''); + let statusMarkdown = getState().getIn(['compose', 'text_markdown'], ''); const media = getState().getIn(['compose', 'media_attachments']); - if ((!status || !status.length) && media.size === 0) { - return; - } + // : hack : + //Prepend http:// to urls in status that don't have protocol + status = status.replace(urlRegex, (match) =>{ + const hasProtocol = match.startsWith('https://') || match.startsWith('http://') + return hasProtocol ? match : `http://${match}` + }) + statusMarkdown = statusMarkdown.replace(urlRegex, (match) =>{ + const hasProtocol = match.startsWith('https://') || match.startsWith('http://') + return hasProtocol ? match : `http://${match}` + }) dispatch(submitComposeRequest()); dispatch(closeModal()); @@ -191,6 +202,7 @@ export function submitCompose(routerHistory, group) { api(getState)[method](endpoint, { status, + statusMarkdown, scheduled_at, in_reply_to_id: getState().getIn(['compose', 'in_reply_to'], null), quote_of_id: getState().getIn(['compose', 'quote_of_id'], null), @@ -593,4 +605,10 @@ export function changeScheduledAt(date) { type: COMPOSE_SCHEDULED_AT_CHANGE, date, }; -}; \ No newline at end of file +}; + +export function changeRichTextEditorControlsVisibility() { + return { + type: COMPOSE_RICH_TEXT_EDITOR_CONTROLS_VISIBILITY, + } +} \ No newline at end of file diff --git a/app/javascript/gabsocial/assets/donor_icon.js b/app/javascript/gabsocial/assets/donor_icon.js new file mode 100644 index 00000000..de574f3e --- /dev/null +++ b/app/javascript/gabsocial/assets/donor_icon.js @@ -0,0 +1,26 @@ +const DonorIcon = ({ + className = '', + width = '24px', + height = '24px', + viewBox = '0 0 24 24', + title = 'Gab.com Donor', +}) => ( + + + + + +) + +export default DonorIcon \ No newline at end of file diff --git a/app/javascript/gabsocial/assets/gab_logo.js b/app/javascript/gabsocial/assets/gab_logo.js index 8fc21415..293e70c7 100644 --- a/app/javascript/gabsocial/assets/gab_logo.js +++ b/app/javascript/gabsocial/assets/gab_logo.js @@ -1,9 +1,11 @@ const GabLogo = ({ + className = _s.fillColorBrand, width = '50px', height = '30px', viewBox = '0 0 50 30' }) => ( - - - diff --git a/app/javascript/gabsocial/assets/investor_icon.js b/app/javascript/gabsocial/assets/investor_icon.js new file mode 100644 index 00000000..ed4da684 --- /dev/null +++ b/app/javascript/gabsocial/assets/investor_icon.js @@ -0,0 +1,26 @@ +const InvestorIcon = ({ + className = '', + width = '24px', + height = '24px', + viewBox = '0 0 24 24', + title = 'Gab.com Investor', +}) => ( + + + + + +) + +export default InvestorIcon \ No newline at end of file diff --git a/app/javascript/gabsocial/assets/pro_icon.js b/app/javascript/gabsocial/assets/pro_icon.js new file mode 100644 index 00000000..326900e6 --- /dev/null +++ b/app/javascript/gabsocial/assets/pro_icon.js @@ -0,0 +1,26 @@ +const ProIcon = ({ + className = '', + width = '24px', + height = '24px', + viewBox = '0 0 24 24', + title = 'GabPRO Account', +}) => ( + + + + + +) + +export default ProIcon \ No newline at end of file diff --git a/app/javascript/gabsocial/components/autosuggest_textbox/autosuggest_textbox.js b/app/javascript/gabsocial/components/autosuggest_textbox/autosuggest_textbox.js index 602588a9..637fd5a4 100644 --- a/app/javascript/gabsocial/components/autosuggest_textbox/autosuggest_textbox.js +++ b/app/javascript/gabsocial/components/autosuggest_textbox/autosuggest_textbox.js @@ -253,10 +253,21 @@ export default class AutosuggestTextbox extends ImmutablePureComponent {
- {/**/} + -