Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tag update #6

Merged
merged 16 commits into from
May 30, 2018
Prev Previous commit
Next Next commit
add tags ajax api
  • Loading branch information
ro4 committed May 25, 2018
commit 1a64e4f76a14bf2275d16c5d7eb3ab6be1758cb9
69 changes: 45 additions & 24 deletions resources/views/components/tags.blade.php
Original file line number Diff line number Diff line change
@@ -1,27 +1,48 @@
<p class="wz-document-header">
<input type="text" name="tags" placeholder="Tags" class="tm-input"/>
</p>
<div class="card-body">
<input type="text" name="tags" placeholder="Tags" class="tm-input" @if(Auth::guest()) style="display: none;" @endif/>
</div>

@push('script')
<script>
jQuery(".tm-input").tagsManager({
prefilled: "{{$pageItem->tags->pluck('name')->implode(',')}}",
CapitalizeFirstLetter: false,
AjaxPush: '/tag',
AjaxPushAllTags: true,
AjaxPushParameters: { 'p': {{$pageID}} },
delimiters: [9, 13, 44],
backspace: [8],
blinkBGColor_1: '#FFFF9C',
blinkBGColor_2: '#CDE69C',
hiddenTagListName: 'hiddenTagListA',
hiddenTagListId: null,
deleteTagsOnBackspace: true,
tagsContainer: null,
tagCloseIcon: '×',
tagClass: '',
validator: null,
onlyTagList: false
});
</script>
@if(!Auth::guest())
<script>
jQuery(".tm-input").tagsManager({
prefilled: "{{$pageItem->tags->pluck('name')->implode(',')}}",
CapitalizeFirstLetter: false,
AjaxPush: '/tag',
AjaxPushAllTags: true,
AjaxPushParameters: {'p': {{$pageID}} },
delimiters: [9, 13, 44],
backspace: [8],
blinkBGColor_1: '#FFFF9C',
blinkBGColor_2: '#CDE69C',
hiddenTagListName: 'hiddenTagListA',
hiddenTagListId: null,
deleteTagsOnBackspace: true,
tagsContainer: null,
tagCloseIcon: '×',
tagClass: '',
validator: null,
onlyTagList: false
});
</script>
@else
<script>
jQuery(".tm-input").tagsManager({
prefilled: "{{$pageItem->tags->pluck('name')->implode(',')}}",
CapitalizeFirstLetter: false,
delimiters: [9, 13, 44],
backspace: [8],
blinkBGColor_1: '#FFFF9C',
blinkBGColor_2: '#CDE69C',
hiddenTagListName: 'hiddenTagListA',
hiddenTagListId: null,
deleteTagsOnBackspace: true,
tagsContainer: null,
tagCloseIcon: '×',
tagClass: 'tm-tag-disabled',
validator: null,
onlyTagList: false
});
</script>
@endif
@endpush