DmitrMakeev commited on
Commit
30b9553
·
verified ·
1 Parent(s): 608243d

Update js/rus/rus.js

Browse files
Files changed (1) hide show
  1. js/rus/rus.js +82 -0
js/rus/rus.js CHANGED
@@ -1123,7 +1123,89 @@ editor.Blocks.add('menu-look-settings-block-block', {
1123
 
1124
 
1125
 
 
 
 
 
 
 
 
 
 
 
 
1126
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1127
 
1128
 
1129
 
 
1123
 
1124
 
1125
 
1126
+ // Создаем новый тип компонента для настройки формы для Сенлера
1127
+ editor.Components.addType('senler_btn_ud_v1-settings-block', {
1128
+ model: {
1129
+ defaults: {
1130
+ content: '<div id="set_senler_btn_ud_1"></div>',
1131
+ script: function(props) {
1132
+ window.w_url = props.w_url;
1133
+ window.vk_grup = props.vk_grup;
1134
+ window.s_grup = props.s_grup;
1135
+ window.on_url = props.on_url;
1136
+ window.off_url = props.off_url;
1137
 
1138
+ const initBlock = () => {
1139
+ console.log('Empty block initialized with props:', { w_url, vk_grup, s_grup, on_url, off_url });
1140
+ };
1141
+ const loadScript = (src, callback) => {
1142
+ const script = document.createElement('script');
1143
+ script.src = src;
1144
+ script.onload = callback;
1145
+ document.body.appendChild(script);
1146
+ };
1147
+ if (typeof vkBridge === 'undefined') {
1148
+ loadScript('https://unpkg.com/@vkontakte/vk-bridge/dist/browser.min.js', () => {
1149
+ console.log('VK Bridge loaded!');
1150
+ initBlock();
1151
+ });
1152
+ } else {
1153
+ initBlock();
1154
+ }
1155
+
1156
+ if (typeof VK === 'undefined') {
1157
+ loadScript('https://vk.com/js/api/openapi.js?169', () => {
1158
+ console.log('VK Open API loaded!');
1159
+ });
1160
+ }
1161
+
1162
+ loadScript('https://huggingface.co/spaces/DMTuit/psy_vk/resolve/main/js/senler_form_v1.js', () => {
1163
+ console.log('Custom script loaded!');
1164
+ });
1165
+ },
1166
+ 'script-props': ['w_url', 'vk_grup', 's_grup', 'on_url', 'off_url'],
1167
+ traits: [
1168
+ {
1169
+ type: 'text',
1170
+ name: 'w_url',
1171
+ label: 'W_URL',
1172
+ changeProp: true
1173
+ },
1174
+ {
1175
+ type: 'text',
1176
+ name: 'vk_grup',
1177
+ label: 'VK_GRUP',
1178
+ changeProp: true
1179
+ },
1180
+ {
1181
+ type: 'text',
1182
+ name: 's_grup',
1183
+ label: 'S_GRUP',
1184
+ changeProp: true
1185
+ },
1186
+ {
1187
+ type: 'text',
1188
+ name: 'on_url',
1189
+ label: 'ON_URL',
1190
+ changeProp: true
1191
+ },
1192
+ {
1193
+ type: 'text',
1194
+ name: 'off_url',
1195
+ label: 'OFF_URL',
1196
+ changeProp: true
1197
+ }
1198
+ ]
1199
+ }
1200
+ }
1201
+ });
1202
+ editor.Blocks.add('senler_form_btn_ud_v1-settings-block-block', {
1203
+ label: `
1204
+ <img src="https://senler.ru/web/images/marketing-1.png" width="64" height="36" alt="senler_form_v">
1205
+ Btn - #user dats_v1`,
1206
+ content: { type: 'senler_form_btn_ud_v1-settings-block' },
1207
+ category: 'ВК - Сенлер', // Добавляем категорию "Сенлер - ВК"
1208
+ });
1209
 
1210
 
1211