Comments: Fixed pointer display, Fixed translation test
This commit is contained in:
		
							parent
							
								
									8f92b6f21b
								
							
						
					
					
						commit
						32b29fcdfc
					
				| 
						 | 
				
			
			@ -58,6 +58,11 @@ describe('Translations Service', () => {
 | 
			
		|||
            expect(caseB).toEqual('an orange angry big dinosaur');
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
        test('it provides count as a replacement by default', () => {
 | 
			
		||||
            const caseA = $trans.choice(`:count cats|:count dogs`, 4);
 | 
			
		||||
            expect(caseA).toEqual('4 dogs');
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
        test('not provided replacements are left as-is', () => {
 | 
			
		||||
            const caseA = $trans.choice(`An :a dog`, 5, {});
 | 
			
		||||
            expect(caseA).toEqual('An :a dog');
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -10,7 +10,7 @@ export class Translator {
 | 
			
		|||
     * to use. Similar format at Laravel's 'trans_choice' helper.
 | 
			
		||||
     */
 | 
			
		||||
    choice(translation: string, count: number, replacements: Record<string, string> = {}): string {
 | 
			
		||||
        replacements = Object.assign({}, replacements, {count: String(count)});
 | 
			
		||||
        replacements = Object.assign({}, {count: String(count)}, replacements);
 | 
			
		||||
        const splitText = translation.split('|');
 | 
			
		||||
        const exactCountRegex = /^{([0-9]+)}/;
 | 
			
		||||
        const rangeRegex = /^\[([0-9]+),([0-9*]+)]/;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -158,11 +158,7 @@ body.tox-fullscreen, body.markdown-fullscreen {
 | 
			
		|||
  border-radius: 4px;
 | 
			
		||||
  box-shadow: 0 0 12px 1px rgba(0, 0, 0, 0.1);
 | 
			
		||||
  @include mixins.lightDark(background-color, #fff, #333);
 | 
			
		||||
  width: 275px;
 | 
			
		||||
 | 
			
		||||
  &.is-page-editable {
 | 
			
		||||
    width: 328px;
 | 
			
		||||
  }
 | 
			
		||||
  width: 328px;
 | 
			
		||||
 | 
			
		||||
  &:before {
 | 
			
		||||
    position: absolute;
 | 
			
		||||
| 
						 | 
				
			
			@ -193,7 +189,8 @@ body.tox-fullscreen, body.markdown-fullscreen {
 | 
			
		|||
    border: 1px solid #DDD;
 | 
			
		||||
    @include mixins.lightDark(border-color, #ddd, #000);
 | 
			
		||||
    color: #666;
 | 
			
		||||
    width: 180px;
 | 
			
		||||
    width: auto;
 | 
			
		||||
    flex: 1;
 | 
			
		||||
    z-index: 58;
 | 
			
		||||
    padding: 5px;
 | 
			
		||||
    border-radius: 0;
 | 
			
		||||
| 
						 | 
				
			
			@ -203,7 +200,8 @@ body.tox-fullscreen, body.markdown-fullscreen {
 | 
			
		|||
  }
 | 
			
		||||
  .input-group .button {
 | 
			
		||||
    line-height: 1;
 | 
			
		||||
    margin: 0 0 0 -5px;
 | 
			
		||||
    margin-inline-start: -1px;
 | 
			
		||||
    margin-block: 0;
 | 
			
		||||
    box-shadow: none;
 | 
			
		||||
    border-radius: 0;
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -6,21 +6,21 @@
 | 
			
		|||
         tabindex="-1"
 | 
			
		||||
         aria-label="{{ trans('entities.pages_pointer_label') }}"
 | 
			
		||||
         class="pointer-container">
 | 
			
		||||
        <div class="pointer flex-container-row items-center justify-space-between gap-xs p-xs anim {{ userCan('page-update', $page) ? 'is-page-editable' : ''}}" >
 | 
			
		||||
            <div refs="pointer@mode-section" class="flex-container-row items-center gap-xs">
 | 
			
		||||
        <div class="pointer flex-container-row items-center justify-space-between gap-xs p-xs anim" >
 | 
			
		||||
            <div refs="pointer@mode-section" class="flex flex-container-row items-center gap-xs">
 | 
			
		||||
                <button refs="pointer@mode-toggle"
 | 
			
		||||
                        title="{{ trans('entities.pages_pointer_toggle_link') }}"
 | 
			
		||||
                        class="text-button icon px-xs">@icon('link')</button>
 | 
			
		||||
                <div class="input-group">
 | 
			
		||||
                <div class="input-group flex flex-container-row items-center">
 | 
			
		||||
                    <input refs="pointer@link-input" aria-label="{{ trans('entities.pages_pointer_permalink') }}" readonly="readonly" type="text" id="pointer-url" placeholder="url">
 | 
			
		||||
                    <button refs="pointer@link-button" class="button outline icon px-xs" type="button" title="{{ trans('entities.pages_copy_link') }}">@icon('copy')</button>
 | 
			
		||||
                </div>
 | 
			
		||||
            </div>
 | 
			
		||||
            <div refs="pointer@mode-section" hidden class="flex-container-row items-center gap-s">
 | 
			
		||||
            <div refs="pointer@mode-section" hidden class="flex flex-container-row items-center gap-xs">
 | 
			
		||||
                <button refs="pointer@mode-toggle"
 | 
			
		||||
                        title="{{ trans('entities.pages_pointer_toggle_include') }}"
 | 
			
		||||
                        class="text-button icon px-xs">@icon('include')</button>
 | 
			
		||||
                <div class="input-group">
 | 
			
		||||
                <div class="input-group flex flex-container-row items-center">
 | 
			
		||||
                    <input refs="pointer@include-input" aria-label="{{ trans('entities.pages_pointer_include_tag') }}" readonly="readonly" type="text" id="pointer-include" placeholder="include">
 | 
			
		||||
                    <button refs="pointer@include-button" class="button outline icon px-xs" type="button" title="{{ trans('entities.pages_copy_link') }}">@icon('copy')</button>
 | 
			
		||||
                </div>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue