initial commit

This commit is contained in:
equippedcoding-master
2025-09-17 09:37:06 -05:00
parent 86108ca47e
commit e2c98790b2
55389 changed files with 6206730 additions and 0 deletions

View File

@@ -0,0 +1,66 @@
#maincontainer {
/* height: 100vh; */
}
/* Let's highlight canvas boundaries */
#gjs {
border: 3px solid #444;
}
/* Reset some default styling */
.gjs-cv-canvas {
top: 0;
width: 100%;
height: 100%;
}
.gjs-block {
width: auto;
height: auto;
min-height: auto;
}
.panel__top {
padding: 0;
width: 100%;
display: flex;
position: initial;
justify-content: center;
justify-content: space-between;
}
.panel__basic-actions {
position: initial;
}
.editor-row {
display: flex;
justify-content: flex-start;
align-items: stretch;
flex-wrap: nowrap;
height: 300px;
}
.editor-canvas {
flex-grow: 1;
}
.panel__right {
flex-basis: 230px;
position: relative;
overflow-y: auto;
}
.panel__switcher {
position: initial;
}

View File

@@ -0,0 +1,5 @@
<div>
<button id="webbuilder-back">Back</button>
<h1>Web Builder</h1>
<button id="open-webbuilder-project">Open Web Builder Project</button>
</div>

View File

@@ -0,0 +1,138 @@
<?php
session_start();
// https://www15.appfactory.studio/portal/admin/services/builder/index.php
// /home/appfactorystudio/websites/www15/portal/admin/services/core/api/php/includes/include.php
require dirname( __DIR__, 3 ) . "/core/api/php/includes/include.php";
// require dirname( __DIR__, 2 ) . "/core/api/php/includes/indexcore.php";
function html($title,$dir){
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title><?php echo $title ?></title>
<link rel="icon" type="image/x-icon" href="<?php echo $dir ?>assets/favicon.ico">
<!-- imported styles -->
<link href='https://unpkg.com/boxicons@2.0.7/css/boxicons.min.css' rel='stylesheet'>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap">
<!-- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous"> -->
<link href="<?php echo $dir ?>portal/admin/core/api/styles/tabler/tabler.min.css" rel="stylesheet"/>
<script src="https://js.stripe.com/v3/"></script>
<!-- imported js -->
<script src="https://code.jquery.com/jquery-3.6.3.min.js" integrity="sha256-pvPw+upLPUjgMXY0G+8O0xUf+/Im1MZjXxxgOcBQBXU=" crossorigin="anonymous"></script>
<!-- <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-kenU1KFdBIe4zVF0s0G1M5b4hcpxyD9F7jL+jjXkk+Q2h455rYXK/7HAuoJl+0I4" crossorigin="anonymous"></script> -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.13.6/underscore-min.js" integrity="sha512-2V49R8ndaagCOnwmj8QnbT1Gz/rie17UouD9Re5WxbzRVUGoftCu5IuqqtAM9+UC3fwfHCSJR1hkzNQh/2wdtg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/backbone.js/1.4.1/backbone-min.js" integrity="sha512-TztyCWDNoN0YKl30gDCMKsiWs35juID+W7ZM2uvPeLLmiNvZg789SglgB/QeUbewqIF2Z4mVq3PyIEa+YXXADQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.4/moment.min.js"></script>
<link rel="stylesheet" href="<?php echo $dir ?>portal/admin/core/api/js/libs/jquery-ui-1.13.2.custom/jquery-ui.min.css">
<link rel="stylesheet" href="<?php echo $dir ?>portal/admin/core/api/js/libs/jquery-ui-1.13.2.custom/jquery-ui.theme.css">
<script src="https://code.jquery.com/ui/1.13.2/jquery-ui.js"></script>
<!-- own js -->
<script src="<?php echo $dir ?>portal/admin/core/api/js/libs/fetch-jsonp.js"></script>
<script src="<?php echo $dir ?>portal/admin/core/api/js/appfactory/appfactory2.js"></script>
<script src="<?php echo $dir ?>portal/admin/core/api/js/appfactory/afsform.js"></script>
<script src="<?php echo $dir ?>portal/admin/core/api/js/appfactory/afsplugin.js"></script>
<script src="<?php echo $dir ?>portal/admin/core/api/js/appfactory/afscard.js"></script>
<script src="<?php echo $dir ?>portal/admin/core/api/js/appfactory/afssponsorship.js"></script>
<script src="<?php echo $dir ?>portal/admin/core/api/js/appfactory/afspayments.js"></script>
<script src="<?php echo $dir ?>portal/admin/core/api/js/appfactory/afsnotificationmanager.js"></script>
<script src="<?php echo $dir ?>portal/admin/core/api/js/appfactory/afsspinner.js"></script>
<script src="<?php echo $dir ?>portal/admin/core/api/js/appfactory/afsdonations.js"></script>
<script src="<?php echo $dir ?>portal/admin/core/api/js/appfactory/afsanalytics.js"></script>
<!-- <script src="<?php echo $dir ?>portal/admin/core/api/js/sameSize.js"></script> -->
<script src="<?php echo $dir ?>portal/admin/core/api/js/default_schema.js"></script>
<script src="<?php echo $dir ?>portal/admin/core/api/js/libs/tabler/tabler.js"></script>
<link rel="stylesheet" href="//unpkg.com/grapesjs/dist/css/grapes.min.css">
<script src="//unpkg.com/grapesjs"></script>
<link rel="stylesheet" href="./css/global.css">
<link rel="stylesheet" href="./css/styles.css">
</head>
<body>
<!-- <div id="maincontainer">
<div class="panel__top">
<div class="panel__basic-actions"></div>
<div class="panel__switcher"></div>
</div>
<div class="editor-row">
<div class="editor-canvas">
<div id="gjs"></div>
</div>
<div class="panel__right">
<div class="layers-container"></div>
<div class="styles-container"></div>
<div class="traits-container"></div>
</div>
</div>
<div id="blocks"></div>
</div> -->
<!-- <script src="<?php echo $dir ?>portal/admin/core/api/js/libs/tabler/demo.js"></script> -->
<script data-main="./js/main" src="<?php echo $dir ?>portal/admin/core/api/js/libs/require.js"></script>
<body>
</html>
<?php
}// END html function
// echo '<pre>';
// var_dump($_SESSION);
// echo '</pre>';
// echo $_SESSION["user_id"];
if (isset($_SESSION["user_id"])) {
// $mysqli = func_get_database();
// $result = $mysqli->query($sql);
// $user = $result->fetch_assoc();
// portal/admin/core/api/js/libs/appfactory/afspayments.js
if($_SESSION["user_id"]==1){
html("Appfactory Studio - Web Builder","../../../../../");
}else{
header("Location: ../index.php");
}
}else{
header("Location: ../../index.php");
}
?>

View File

@@ -0,0 +1,17 @@
define([],function () {
function hello(){
console.log(api);
return true;
}
// api.registerListener('dashboard', hello);
return hello;
});

View File

@@ -0,0 +1,343 @@
(function(){
const REQUEST_URL = "./php/request.php";
const LOADER_ID = "afs-main-loader-screen";
const LOADER_REMOVE_WAIT = 0;
const TABLE = "admin_users";
$.post(REQUEST_URL,{
init: true
},function(schemas){
schemas = JSON.parse(schemas);
console.log(schemas)
//document.body.insertAdjacentHTML("afterbegin", application_loader_screen_html());
func_run_application2();
});
function func_run_application2(){
const editor = grapesjs.init({
// Indicate where to init the editor. You can also pass an HTMLElement
container: '#gjs',
// Get the content for the canvas directly from the element
// As an alternative we could use: `components: '<h1>Hello World Component!</h1>'`,
fromElement: true,
// Size of the editor
height: '300px',
width: 'auto',
// Disable the storage manager for the moment
storageManager: false,
// Avoid any default panel
panels: { defaults: [] },
layerManager: {
appendTo: '.layers-container'
},
blockManager: {
appendTo: '#blocks',
blocks: [
{
id: 'section', // id is mandatory
label: '<b>Section</b>', // You can use HTML/SVG inside labels
attributes: { class:'gjs-block-section' },
content: `<section>
<h1>This is a simple title</h1>
<div>This is just a Lorem text: Lorem ipsum dolor sit amet</div>
</section>`,
}, {
id: 'text',
label: 'Text',
content: '<div data-gjs-type="text">Insert your text here</div>',
}, {
id: 'image',
label: 'Image',
// Select the component once it's dropped
select: true,
// You can pass components as a JSON instead of a simple HTML string,
// in this case we also use a defined component type `image`
content: { type: 'image' },
// This triggers `active` event on dropped components and the `image`
// reacts by opening the AssetManager
activate: true,
}
]
},
panels: {
defaults: [
{
id: 'layers',
el: '.panel__right',
// Make the panel resizable
resizable: {
maxDim: 350,
minDim: 200,
tc: 0, // Top handler
cl: 1, // Left handler
cr: 0, // Right handler
bc: 0, // Bottom handler
// Being a flex child we need to change `flex-basis` property
// instead of the `width` (default)
keyWidth: 'flex-basis',
}
},
{
id: 'panel-switcher',
el: '.panel__switcher',
buttons: [{
id: 'show-layers',
active: true,
label: 'Layers',
command: 'show-layers',
// Once activated disable the possibility to turn it off
togglable: false,
}, {
id: 'show-style',
active: true,
label: 'Styles',
command: 'show-styles',
togglable: false,
}],
},
{
id: 'panel-switcher',
el: '.panel__switcher',
buttons: [
// ...
{
id: 'show-traits',
active: true,
label: 'Traits',
command: 'show-traits',
togglable: false,
}]
}
]
},
traitManager: {
appendTo: '.traits-container',
},
// The Selector Manager allows to assign classes and
// different states (eg. :hover) on components.
// Generally, it's used in conjunction with Style Manager
// but it's not mandatory
selectorManager: {
appendTo: '.styles-container'
},
styleManager: {
appendTo: '.styles-container',
sectors: [{
name: 'Dimension',
open: false,
// Use built-in properties
buildProps: ['width', 'min-height', 'padding'],
// Use `properties` to define/override single property
properties: [
{
// Type of the input,
// options: integer | radio | select | color | slider | file | composite | stack
type: 'integer',
name: 'The width', // Label for the property
property: 'width', // CSS property (if buildProps contains it will be extended)
units: ['px', '%'], // Units, available only for 'integer' types
defaults: 'auto', // Default value
min: 0, // Min value, available only for 'integer' types
}
]
},{
name: 'Extra',
open: false,
buildProps: ['background-color', 'box-shadow', 'custom-prop'],
properties: [
{
id: 'custom-prop',
name: 'Custom Label',
property: 'font-size',
type: 'select',
defaults: '32px',
// List of options, available only for 'select' and 'radio' types
options: [
{ value: '12px', name: 'Tiny' },
{ value: '18px', name: 'Medium' },
{ value: '32px', name: 'Big' },
],
}
]
}]
}
});
editor.BlockManager.add('my-block-id', {
// ...
content: {
tagName: 'div',
draggable: false,
attributes: { 'some-attribute': 'some-value' },
components: [
{
tagName: 'span',
content: '<b>Some static content</b>',
}, {
tagName: 'div',
// use `content` for static strings, `components` string will be parsed
// and transformed in Components
components: '<span>HTML at some point</span>',
}
]
}
});
// The wrapper is the root Component
// const wrapper = editor.DomComponents.getWrapper();
// const myComponent = wrapper.find('div.my-component')[0];
// myComponent.components().forEach(component => console.log(component));
// myComponent.components('<div>New content</div>');
editor.Panels.addPanel({
id: 'panel-top',
el: '.panel__top',
});
editor.Panels.addPanel({
id: 'basic-actions',
el: '.panel__basic-actions',
buttons: [
{
id: 'visibility',
active: true, // active by default
className: 'btn-toggle-borders',
label: '<u>B</u>',
command: 'sw-visibility', // Built-in command
}, {
id: 'export',
className: 'btn-open-export',
label: 'Exp',
command: 'export-template',
context: 'export-template', // For grouping context of buttons from the same panel
}, {
id: 'show-json',
className: 'btn-show-json',
label: 'JSON',
context: 'show-json',
command(editor) {
editor.Modal.setTitle('Components JSON')
.setContent(`<textarea style="width:100%; height: 250px;">
${JSON.stringify(editor.getComponents())}
</textarea>`)
.open();
},
}
],
});
editor.Commands.add('show-layers', {
getRowEl(editor) { return editor.getContainer().closest('.editor-row'); },
getLayersEl(row) { return row.querySelector('.layers-container') },
run(editor, sender) {
const lmEl = this.getLayersEl(this.getRowEl(editor));
lmEl.style.display = '';
},
stop(editor, sender) {
const lmEl = this.getLayersEl(this.getRowEl(editor));
lmEl.style.display = 'none';
},
});
editor.Commands.add('show-styles', {
getRowEl(editor) { return editor.getContainer().closest('.editor-row'); },
getStyleEl(row) { return row.querySelector('.styles-container') },
run(editor, sender) {
const smEl = this.getStyleEl(this.getRowEl(editor));
smEl.style.display = '';
},
stop(editor, sender) {
const smEl = this.getStyleEl(this.getRowEl(editor));
smEl.style.display = 'none';
},
});
editor.Commands.add('show-traits', {
getTraitsEl(editor) {
const row = editor.getContainer().closest('.editor-row');
return row.querySelector('.traits-container');
},
run(editor, sender) {
this.getTraitsEl(editor).style.display = '';
},
stop(editor, sender) {
this.getTraitsEl(editor).style.display = 'none';
},
});
}
function func_run_application(usereData,schemas,paymentsObj){
$.post(REQUEST_URL, {
api_get_folder_templates:true,
path: "/admin/core/html",
backpath: 5
},function(html){
//console.log(html);
$.post(REQUEST_URL, {retrieve_data_for_update: true }, function(resp){
afsconfig = JSON.parse(resp);
console.log(afsconfig);
let app = new ApplicationContextManager();
app.extra.config = AFS_SCHEMA_DESCRIPTION_INTEGRATION(afsconfig);
app.extra.config.html = JSON.parse(html);
app.extra.config.user = JSON.parse(usereData);
app.extra.config.schemas = schemas;
app.extra.url = REQUEST_URL;
// app.extra.pay = afsconfig.configurations.paypal;
app.extra.paymentsObj = paymentsObj;
app.extra.processor = new AFSPayments(app, afsconfig.managed_domain);
requirejs.config({ baseUrl: 'core/api/js/' });
let routes = ["pages/index","pages/schema"];
require(routes, function(_route_func){
setTimeout(() => {
$("#"+LOADER_ID).remove();
_route_func(app);
// setTimeout(() => {
$("#console_custome_log").empty();
$("#console_custome_log").append(`<a id="_logolinkheader_" href="#">${app.extra.config.configurations.settings[0].json.dashboard.web_console_label}</a>`);
// console.log("running");
//},1000);
},LOADER_REMOVE_WAIT);
});
});
});
}
function application_loader_screen_html(){
return `
<div id="${LOADER_ID}">
<div class="page page-center">
<div class="container container-slim py-4">
<div class="text-center">
<div class="mb-3">
<a href="." class="navbar-brand navbar-brand-autodark"><img src="./static/logo-small.svg" height="36" alt=""></a>
</div>
<div class="text-secondary mb-3">Preparing dashboard</div>
<div class="progress progress-sm">
<div class="progress-bar progress-bar-indeterminate"></div>
</div>
</div>
</div>
</div>
</div>
`;
}
})();

View File

@@ -0,0 +1,30 @@
<?php
require dirname( __DIR__, 4 ) . "/core/api/php/includes/include.php";
function init(){
echo json_encode(array("success" => true));
}
if(Input::get("init")){
init();
}
?>