-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:scify/Crowdsourcing-Platform
- Loading branch information
Showing
8 changed files
with
195 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
// import "select2"; | ||
// import "summernote/dist/summernote-bs4.min"; | ||
|
||
// import { createApp } from "vue"; | ||
// import store from "../store/store"; | ||
|
||
// import TranslationsManager from "../vue-components/common/TranslationsManager.vue"; | ||
// import CrowdSourcingProjectColors from "../vue-components/crowd-sourcing-project/CrowdSourcingProjectColors.vue"; | ||
|
||
// import select2 from "select2"; | ||
import $ from "jquery"; | ||
|
||
// select2($); | ||
|
||
// const app = createApp({ | ||
// components: { | ||
// TranslationsManager, | ||
// CrowdSourcingProjectColors, | ||
// }, | ||
// }); | ||
|
||
// app.use(store); | ||
// app.mount("#app"); | ||
|
||
(function () { | ||
// const initializeSummernote = function () { | ||
// window.setTimeout(function () { | ||
// $(".summernote").summernote({ | ||
// height: 150, // set editable area's height | ||
// prettifyHtml: true, | ||
// }); | ||
// initializeCommunicationResourcesHandlers(); | ||
// }, 2000); | ||
// }; | ||
|
||
// const initializeSubmitFormListener = function () { | ||
// $("#project-form").one("submit", function (event) { | ||
// event.preventDefault(); | ||
// fixAllSummerNoteCodes(); | ||
// $(this).submit(); | ||
// }); | ||
// }; | ||
|
||
// const fixAllSummerNoteCodes = function () { | ||
// $(".summernote").each((index, element) => { | ||
// updateSummerNoteCodeContent($(element)); | ||
// }); | ||
// }; | ||
|
||
// const updateSummerNoteCodeContent = function (el) { | ||
// el.val(el.summernote("code")); | ||
// }; | ||
|
||
// const initializeImgFileChangePreviewHandlers = function () { | ||
// $(".image-input").each(function (i, obj) { | ||
// $(obj).change(function () { | ||
// const event = this; | ||
// if (event.files && event.files[0]) { | ||
// const parent = $(obj).closest(".image-input-container"); | ||
// const imgPreview = parent.find(".selected-image-preview"); | ||
// const reader = new FileReader(); | ||
// reader.onload = function (e) { | ||
// imgPreview.attr("src", e.target.result); | ||
// }; | ||
// reader.readAsDataURL(event.files[0]); | ||
// } | ||
// }); | ||
// }); | ||
// }; | ||
|
||
// const initializeCommunicationResourcesHandlers = function () { | ||
// initializeSummernoteAndUpdateElementOnKeyup($("#questionnaire_response_email_intro_text"), $("#intro_text")); | ||
// initializeSummernoteAndUpdateElementOnKeyup($("#questionnaire_response_email_outro_text"), $("#outro_text")); | ||
// }; | ||
|
||
// const initializeSummernoteAndUpdateElementOnKeyup = function (summernoteEl, targetEl) { | ||
// summernoteEl.summernote({ | ||
// height: 150, | ||
// callbacks: { | ||
// onChange: function (contents) { | ||
// setTimeout(function () { | ||
// targetEl.html(contents); | ||
// }, 50); | ||
// }, | ||
// }, | ||
// }); | ||
// }; | ||
|
||
// const initializeSocialMediaKeywordsTags = function () { | ||
// $("#social-media-tab").one("click", function () { | ||
// window.setTimeout(function () { | ||
// $("#sm_keywords").select2({ | ||
// tags: true, | ||
// }); | ||
// }, 200); | ||
// }); | ||
// }; | ||
|
||
const checkURLAndActivateTranslationsTab = function () { | ||
// should check the URL for a `translations=1` variable and if set and if true, it should activate the tab. SEE DESCR | ||
if ( (window.location.search.indexOf("?translations=1") > -1) || (window.location.search.indexOf("&translations=1") > -1)) { | ||
$("#translations-tab").click(); | ||
} | ||
}; | ||
|
||
const init = function () { | ||
// initializeSubmitFormListener(); | ||
// initializeImgFileChangePreviewHandlers(); | ||
// initializeSummernote(); | ||
// initializeSocialMediaKeywordsTags(); | ||
checkURLAndActivateTranslationsTab(); | ||
}; | ||
|
||
$(document).ready(function () { | ||
init(); | ||
}); | ||
|
||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
...views/loggedin-environment/management/problem/create-edit/partials/translations.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<div class="row"> | ||
<div class="col-sm-12"> | ||
<div class="card"> | ||
<div class="card-body"> | ||
|
||
@if (!$viewModel->isEditMode()) | ||
Please <b>save the problem first </b> to start translating. | ||
@else | ||
{{-- | ||
<translations-manager | ||
:model-meta-data='@json( $viewModel->translationsMetaData)' | ||
:existing-translations=' @json( $viewModel->translations)' | ||
:default-lang-id="{{ $viewModel->project->language_id }}"> | ||
</translations-manager> | ||
--}} | ||
|
||
translations component | ||
|
||
@endif | ||
|
||
</div> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters