Skip to content

Commit 9eb05b1

Browse files
committed
feat: add kernal mode initial check
1 parent 3f6ca85 commit 9eb05b1

File tree

2 files changed

+29
-2
lines changed

2 files changed

+29
-2
lines changed

src/LiveDevelopment/LivePreviewEdit.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,29 @@
1+
/*
2+
* GNU AGPL-3.0 License
3+
*
4+
* Copyright (c) 2021 - present core.ai . All rights reserved.
5+
* Original work Copyright (c) 2012 - 2021 Adobe Systems Incorporated. All rights reserved.
6+
*
7+
* This program is free software: you can redistribute it and/or modify it
8+
* under the terms of the GNU Affero General Public License as published by
9+
* the Free Software Foundation, either version 3 of the License, or
10+
* (at your option) any later version.
11+
*
12+
* This program is distributed in the hope that it will be useful, but WITHOUT
13+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License
15+
* for more details.
16+
*
17+
* You should have received a copy of the GNU Affero General Public License
18+
* along with this program. If not, see https://opensource.org/licenses/AGPL-3.0.
19+
*
20+
*/
21+
22+
/*
23+
* This file handles all the editor side source code handling after user performed some live preview edit operation
24+
* when any operation is performed in the browser context (handled inside remoteFunctions.js) it sends a message through
25+
* MessageBroker, now this file then makes the change in the source code
26+
*/
127
define(function (require, exports, module) {
228
const HTMLInstrumentation = require("LiveDevelopment/MultiBrowserImpl/language/HTMLInstrumentation");
329
const LiveDevMultiBrowser = require("LiveDevelopment/LiveDevMultiBrowser");

src/LiveDevelopment/main.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ define(function main(require, exports, module) {
4747

4848

4949
// this is responsible to make the advanced live preview features active or inactive
50-
// @abose (make this variable false when not a paid user, everything rest is handled automatically)
51-
let isLPEditFeaturesActive = false;
50+
// @abose (make the first value true when its a paid user, everything rest is handled automatically)
51+
let isLPEditFeaturesActive = window.KernalModeTrust ? false : false;
5252

5353
const EVENT_LIVE_HIGHLIGHT_PREF_CHANGED = "liveHighlightPrefChange";
5454

@@ -409,6 +409,7 @@ define(function main(require, exports, module) {
409409
config.highlight = PreferencesManager.getViewState("livedevHighlight");
410410

411411
function setLivePreviewEditFeaturesActive(enabled) {
412+
// TODO: @abose here add kernal mode trust check
412413
isLPEditFeaturesActive = enabled;
413414
config.isLPEditFeaturesActive = enabled;
414415
if (MultiBrowserLiveDev && MultiBrowserLiveDev.status >= MultiBrowserLiveDev.STATUS_ACTIVE) {

0 commit comments

Comments
 (0)