Data not getting into the database

I am trying to send data into the database but unfortunately its returning null…
The button with type=”submit” is working well it is saving all the marks of the student at once but the button which is saving one subject at at time
the one with “SaveSingleSubject” class is the one returning null on the fields, exam_work,class_work,test_work…
what is the issue
blade code

@if (!empty($getStudent) && !empty($getStudent->count()))
    @foreach ($getStudent as $student)
        <form name="post" class="SubmitForm">
            {{csrf_field()}}
            <input type="hidden" name="student_id" value="{{$student->id}}">
            <input type="hidden" name="exam_id" value="{{Request::get('exam_id')}}">
            <input type="hidden" name="class_id"
                   value="{{Request::get('class_id')}}">
            <tr>
                <td>{{$student->name}}{{$student->last_name}}</td>
                @php
                    $i = 1;
                @endphp
                @foreach ($getSubject as $subject)
                    @php
                        $getMark = $subject->getMark($student->id, Request::get('exam_id'), Request::get('class_id'), $subject->subject_id);
                    @endphp
                    <td>
                        <div style="margin-bottom: 10px;">
                            Class Work
                            <input type="hidden" name="mark[{{$i}}][subject_id]"
                                   value="{{$subject->subject_id}}" style="width: 200px;"
                                   class="form_control" placeholder="Enter Marks">
                            <input type="text" name="mark[{{$i}}][class_work]"
                                   id="class_work_{{$student->id}}{{$subject->id}}"
                                   style="width: 200px;" class="form_control"
                                   placeholder="Enter Marks"
                                   value="{{!empty($getMark->class_work) ? $getMark->class_work : ''}}">
                        </div>
                        <div style="margin-bottom: 10px;">
                            Home Work
                            <input type="text" name="mark[{{$i}}][home_work]"
                                   id="home_work_{{$student->id}}{{$subject->id}}"
                                   style="width: 200px;" class="form_control"
                                   placeholder="Enter Marks"
                                   value="{{!empty($getMark->home_work) ? $getMark->home_work : ''}}">
                        </div>
                        <div style="margin-bottom: 10px;">
                            Test Work
                            <input type="text" name="mark[{{$i}}][test_work]"
                                   id="test_work_{{$student->id}}{{$subject->id}}"
                                   style="width: 200px;" class="form_control"
                                   placeholder="Enter Marks"
                                   value="{{!empty($getMark->test_work) ? $getMark->test_work : ''}}">
                        </div>
                        <div style="margin-bottom: 10px;">
                            Exam Work
                            <input type="text" name="mark[{{$i}}][exam_work]"
                                   id="exam_work_{{$student->id}}{{$subject->id}}"
                                   style="width: 200px;" class="form_control"
                                   placeholder="Enter Marks"
                                   value="{{!empty($getMark->exam_work) ? $getMark->exam_work : ''}}">
                        </div>

                        <div style="margin-bottom: 10px;">
                            <button type="button"
                                    class="btn btn-primary SaveSingleSubject"
                                    id="{{$student->id}}"
                                    data-val="{{$subject->subject_id}}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        "
                                    data-exam="{{Request::get('exam_id')}}"
                                    data-class="{{Request::get('class_id')}}">Save
                            </button>
                        </div>
                    </td>
                    @php
                        $i++;
                    @endphp
                @endforeach
                <td>
                    <button type="submit" class="btn btn-success">Save</button>
                </td>
            </tr>
        </form>
        @endforeach
        @endif


        </tbody>
        </table>
        </div>
        </div>
        @endif


        <script type="text/javascript">
            $('.SubmitForm').submit(function (e) {
                e.preventDefault();
                $.ajax({
                    type: "POST",
                    url: "{{url('admin/examinations/submit_marks_register')}}",
                    data: $(this).serialize(),
                    dataType: "json",
                    success: function (data) {
                        alert(data.message);
                    }
                });
            });

            $('.SaveSingleSubject').click(function (e) {
                var student_id = $(this).attr('id');
                var subject_id = $(this).attr('data-val');
                var exam_id = $(this).attr('data-exam');
                var class_id = $(this).attr('data-class');
                var class_work = $('#class_work_' + student_id + subject_id).val();
                var home_work = $('#home_work_' + student_id + subject_id).val();
                var test_work = $('#test_work_' + student_id + subject_id).val();
                var exam_work = $('#exam_work_' + student_id + subject_id).val();


                $.ajax({
                    type: "POST",
                    url: "{{url('admin/examinations/single_submit_marks_register')}}",
                    data: {
                        "_token": "{{csrf_token()}}",
                        student_id: student_id,
                        subject_id: subject_id,
                        exam_id: exam_id,
                        class_id: class_id,
                        class_work: class_work,
                        home_work: home_work,
                        test_work: test_work,
                        exam_work: exam_work,


                    },
                    dataType: "json",
                    success: function (data) {
                        alert(data.message);
                    }
                });
            });


        </script>
        </body>

        </html>

controller file-> this is the controller file

 public function single_submit_marks_register(Request $request)
    {

        Log::info('Request Data:', $request->all());
        $class_work = !empty($request->class_work) ? $request->class_work : 0;
        $home_work = !empty($request->home_work) ? $request->home_work : 0;
        $test_work = !empty($request->test_work) ? $request->test_work : 0;
        $exam_work = !empty($request->exam_work) ? $request->exam_work : 0;

        $getMark = marksregistermodel::CheckAlreadyMark($request->student_id, $request->exam_id, $request->class_id, $request->subject_id);
        if (!empty($getMark)) {
            $save = $getMark;
        } else {
            $save = new marksregistermodel;
            $save->created_by = Auth::user()->id;
        }

        $save->student_id = $request->student_id;
        $save->exam_id = $request->exam_id;
        $save->class_id = $request->class_id;
        $save->subject_id = $request->subject_id;
        $save->class_work = $class_work;
        $save->home_work = $home_work;
        $save->test_work = $test_work;
        $save->exam_work = $exam_work;

        $save->save();

        $json['message'] = "Mark Register Successfully Saved";
        echo json_encode($json);
    }

error logs
the following are the logs am recieving when I click the save button the class_id,subject_id,student_id are working fine but the rest are returning null

[2024-07-23 14:58:57] local.INFO: Request Data: {"_token":"NUxJAZgGntTF65oczF8elM3fudmIxTjYPqY5OyN4","student_id":"34","subject_id":"11","exam_id":"2","class_id":"4","class_work":null,"home_work":null,"test_work":null,"exam_work":null} 

How to display the text correctly if the shape is mirrored along the axes?

My some models:

function getShape() {
  return {
    models: {
      shape: {
        paths: {
          side1: new makerjs.paths.Line([0, 0], [L, 0]),
          side2: new makerjs.paths.Line([200, 0], [50, H]),
          side3: new makerjs.paths.Line([50, H], [50, H]),
          side4: new makerjs.paths.Line([50, H], [0, 0]),
        },
      },
      text: {
        caption: new makerjs.models.Text(window.makerjs_font, `Some Text`, font_size);
      },
    },
  };
}

Without mirroring and rotation:

enter image description here

After mirroring:

enter image description here

What techniques are there to display text after mirroring as well as before mirroring?

To make the text appear the same at different sizes of the form, I use scaling.

NPM Error: Cannot find module ‘C:Program Filesnodejsnode_modulesnpmbinnpm-cli.js’ on specific Node version

I have an old project I used to run using the 12.16.1 version of Node. My machine was wiped clean, so now when I tried to use npm i on the 12.16.1 version of Node I get the following error:

internal/modules/cjs/loader.js:985
  throw err;
  ^

Error: Cannot find module 'C:Program Filesnodejsnode_modulesnpmbinnpm-cli.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:982:15)
    at Function.Module._load (internal/modules/cjs/loader.js:864:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
    at internal/main/run_main_module.js:18:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}
internal/modules/cjs/loader.js:985
  throw err;
  ^

Error: Cannot find module 'C:Program Filesnodejsnode_modulesnpmbinnpm-cli.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:982:15)
    at Function.Module._load (internal/modules/cjs/loader.js:864:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
    at internal/main/run_main_module.js:18:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

The problem is that, as far as I’m concerned, my Path is configured the right way. It’s just that the node_modulesnpmbinnpm-cli.js doesn’t exist on my nodejs directory. When I change it to the version 18.12.0 of Node I get the path with everything inside, but there are many conflicts with the older packages I’m trying to install, so I’ll have a lot of trouble to fix every single dependency conflict if I try going through that route.

I’ve installed 12.16.1 through nvm install and have already done nvm uninstall and installed it again through nvm, but the node_modules directory is still empty. Any clues to what could be the fix? Running on Windows.

How to use JavaScript Event Handler to make an image dissapear when clicking on it

I’m learning JavaScript and I want to make a section of my code change to display: none when clicking on an image that is inside the section of code. I’m trying to add an event handler but it doesn’t seem to be working, even though examples I’ve followed have the same structure.

This is my js file.

let banner = document.getElementById("banner");
let screen1 = document.getElementById("screen1");

function changeDisplay() {
    screen1.style.display = "none"
}

banner.addEventListener("click", changeDisplay);

And this is the relevant html portion.

<body>
    <script src="interactive.js"></script>

    <!-- Header -->
    <div id="screen1" class="header section">

      <!-- Title -->
      <div id="title">
        <img src="./resources/triForceIcon.png">
        <h1>The Legend of Zelda: Almanac</h1>
        <img src="./resources/triForceIcon.png">
      </div>

      <!-- Subtitle -->
      <h3>A Complete Collection of all TLoZ Games</h3>

      <!-- Main Image -->
      <img id="banner" src="./resources/header-image.jpg">
    </div>
</body>

How to implement functions to work on an arguments object?

I am currently doing my coding bootcamp course and I’m quite stuck on the first function that I need to implement which needs to pass a series of tests which I have included below.

Tests that need to pass

Now, I know how the arguments object works and how it’s accessed, but I’m struggling to figure out exactly what the test wants me to do with the arguments object.

Now, I’m not asking for a complete solution to the problem since the course provider strictly doesn’t condone using AI or other resources to find solutions to the problems, also this specific test for the arguments object is in other functions I need to implement. I want to grasp an understanding of what exactly the test is asking me to implement and maybe be given advice that will put my in the right direction?

At the moment, I’m checking if the array passed to the function as an argument is an arguments object, if so, I’m converting the array-like object into a real array, then assigning it to the array parameter.

Below is the current state of my code:

_.first = function (array, n) {
  if (!Array.isArray(array)) {
    if (Object.prototype.toString.call(array) == '[object Arguments]') {
      array = Array.prototype.slice(array);
    } else {
      return [];
    }
  }
  if (typeof n != 'number' || n == 0 || n < 0) {
    return array.slice(0, 1);
  } else {
    return array.slice(0, n);
  }
};

Highcharts Piechart 3D Tooltip nit showing

I am not able to see the tooltip on hover of slices in 3d pie chart.
Even the site example at https://www.highcharts.com/demo/highcharts/3d-pie is not showing tooltip. V11.4.6
Is there any value that I have to set to be able to see this tooltip.
It is working on lower version but on these versions, I am not able to remove the functionality where when we click on a legend the slice associated with it gets removed.

I’m using an API to pull NFL data for this upcoming seasons and I’m getting a reference error in my code. Why am I getting this reference error

function fetchImage() {
    const options = {
        method: 'GET',
        headers: {
            'x-rapidapi-key': secretkey,
            'x-rapidapi-host': 'nfl-api-data.p.rapidapi.com'
        }
    };

    fetch('https://nfl-api-data.p.rapidapi.com/nfl-ath-img?id=3139477', options)
    .then(response => response.json())
    .then(response => {
        const data = response.image.href;
        const blob = new Blob([data], {type: 'image/png' });  
        let container = document.getElementById('image-container'); /* Error is here */
        let imageElement = document.createElement('img');
        imageElement.src = data;
        container.appendChild(imageElement); 
        
    })
    .catch(err => console.error(err));
}
fetchImage();

This is the error I was getting:

ReferenceError: document is not defined
    at c:AnalyticsWebsitejsindex.js:29:25
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {stack: 'ReferenceError: document is not defined
    a…ions (node:internal/process/task_queues:95:5)', message: 'document is not defined'}

I tried taking the line of code with document.getElementId('image-container') out of the function because I thought maybe that had something to do with it but then my code just stopped working. By the way the code works and prints the image that I wanted from the api, it’s just I’m looking to figure out why I’m getting that error.

Error: Objects are not valid as a React child (found: object with keys {message}). If you meant to render a collection of children, use an array

I’m not able to solve the problem even after reading several related posts.

Basically, I’m trying to post some data from my React app to MongoDB using axios. However, it seems the data format is problematic that it cannot be posted to the database.

The code making post request

const { data } = await axios.post(
  "/api/chats/new-group",
  {
    chatName: groupChatName,
    users: JSON.stringify(
      selectedUsers.map((selectedUser) => selectedUser._id)
    ),
  },
  config
);

Browser log

HTTP Header
HTTP Payload
It’s not a routing problem (given the 400 error code).

The schema to be matched

const chatSchema = mongoose.Schema(
  {
    chatName: { type: String, trim: true },
    isGroupChat: { type: Boolean, default: false },
    users: [
      {
        type: mongoose.Schema.Types.ObjectId,
        ref: "User",
      },
    ],
    latestMessage: {
      type: mongoose.Schema.Types.ObjectId,
      ref: "Message",
    },
    groupAdmin: {
      type: mongoose.Schema.Types.ObjectId,
      ref: "User",
    },
  },
  { timestamps: true }
);

My confusion

It can be observed from the payload that the data has the structure below:

object:
  chatName - string
  users - array of user id strings

It seems to match the schema. I tried moving JSON.stringify around the object to stringify it since the error message seems to say axios.post does not want an object, but this does not solve the problem.

I’m relatively new to React, so I’d appreciate your help.

Why update state during delete in Angular services doesn’t rerender component?

I’ve two components getting

todos.services.ts:

import { Injectable } from '@angular/core';
import { TodoItem } from '../interfaces/todo-item';

@Injectable({
  providedIn: 'root',
})
export class TodosService {
  protected todoList: TodoItem[] = [
    {
      id: 1,
      title: 'Купить хлеба',
      description: 'Сходить и купить немного хлеба, а то жена заклевала уже.',
      isComplete: true,
    },
    {
      id: 2,
      title: 'Купить селедки',
      description: 'Сходить и купить селедочку, а то закусывать надо.',
      isComplete: false,
    },
    {
      id: 3,
      title: 'Купить пива',
      description: 'Просто купить холодненького и освежающего.',
      isComplete: false,
    },
    {
      id: 4,
      title: 'Связать носки',
      description: 'Да, надо готовиться к зиме.',
      isComplete: false,
    },
    {
      id: 5,
      title: 'Погладить кота',
      description: 'Ну а почему бы и нет?!.',
      isComplete: false,
    },
    {
      id: 6,
      title: 'Засунуть руку в унитаз',
      description: 'Зачем и нет?!.',
      isComplete: false,
    },
  ];

  constructor() {
    // this.todoList = JSON.parse(localStorage.getItem('todoList'));
  }

  getAllTodos(): TodoItem[] {
    return this.todoList;
  }

  deleteTodo(id: number): void {
    const todoItemIndex = this.todoList.findIndex((todo) => todo.id === id);
    this.todoList.splice(todoItemIndex, 1);
  }

  completeTodo(id: number) {
    this.todoList = this.todoList.map((todo) => {
      if (todo.id === id) {
        todo.isComplete = !todo.isComplete;
        return todo;
      }

      return todo;
    });
  }

  createTodo(todo: TodoItem): void {
    this.todoList.push(todo);
  }

  updateTodo(id: number) {}
}

todo-item.component.html

<li
  class="flex flex-row border rounded-lg p-3 cursor-pointer my-3 {{
    todoItem.isComplete ? 'isComplete' : ''
  }}"
  (click)="toggleComplete(todoItem.id)"
>
  <div class="flex flex-col w-3/4">
    <h3>{{ todoItem.title }}</h3>
    <p class="text-xs text-gray-400">
      {{ todoItem.description }}
    </p>
  </div>
  <div class="flex flex-col justify-center w-1/4">
    <button
      class="flex items-center justify-center rounded-lg text-white bg-blue-700 px-3 py-2 h-1/2"
      (click)="editTodo(todoItem.id)"
    >
      Edit task
    </button>
    <button
      (click)="deleteTodo(todoItem.id)"
      class="flex items-center justify-center rounded-lg text-white bg-red-700 px-3 py-2 h-1/2 mt-3"
    >
      {{ todoItem.id }}
      Delete task
    </button>
  </div>
</li>

todo-item.component.ts

import { Component, inject, Input } from '@angular/core';
import { TodoItem } from '../interfaces/todo-item';
import { TodosService } from '../services/todos.service';

@Component({
  selector: 'app-todo-item',
  standalone: true,
  imports: [],
  templateUrl: './todo-item.component.html',
  styleUrl: './todo-item.component.css',
})
export class TodoItemComponent {
  @Input() todoItem!: TodoItem;

  todosService: TodosService = inject(TodosService);

  deleteTodo(id: number): void {
    this.todosService.deleteTodo(id);
  }

  toggleComplete(id: number): void {
    this.todosService.completeTodo(id);
  }

  editTodo(id: number): void {
    this.todosService.updateTodo(id);
  }
}

So the first click works well. It deletes todo and rerender a component. The next clicks only delete items from array, but no rerender is happening. Why?

I tried to do this.todoList = this.todoList.filter(todo => todo.id !== id) function. It also only update array state, but no rerender is happening. What I do wrong?

How to prevent re-render in React JS when a counter function in another component updates store? (zustand, immer)

I had many problems with re-Rendering (not with updating the DOM, that worked fine!) while working with useContext. Now i switched to ‘zustand’ and solved almost all my problems I had.

In my project I have a ‘zustand’ store which gets new informations from periodical fetching.

In another component I want to initially load the stored information when I navigate to that component and then store it in another position at the store.
But here the state variables seem to be always locked together.

For playing around,

I built an Codesandbox.io Zustand Immer Example with all components (starting with a headline). For better visualisation install

https://addons.mozilla.org/en-US/firefox/addon/react-devtools/

to see components highlighting if re-Rendered. (otherwise I also included a console.log)

Every 5 sec the “CircleComponent” will be updated (here set to [“yellow”,”blue”,”yellow”]).
It will only get re-rendered if the colors change, that’s what I intended.

I can click on the “Editable Circles” and only this component re-renders. Then i click on “submit Colors” and then both color Component re-Render but only the top color-component one needs to re-render (first problem). Then after another 5 seconds, the default color is loaded and again both color components re-Render (second problem). The bottom one shouldn’t need to re-render

Codesandbox.io Zustand Immer Example

best to view it in a browser and watch the log for component re-render or use react devtools plugin and switch on “Highlight updates when components render”

my example store looks something like that:

export const useAppStore = createWithEqualityFn<AppState>()(
  immer((set) => {    
    return {
      counter: 0,
      text: '',
      colorArray: ["red", "green", "blue"],  
};
  }),
  shallow
);

subscription in critical component “EditableCircleComponent.tsx”:

const initialColors = useAppStore((state) => state.colorArray);
const setColorArray = useAppStore((state) => state.setColorArray);
const [localColors, setLocalColors] = useState(initialColors);

if i replace:

const initialColors = useAppStore((state) => state.colorArray);

with:

const initialColors = ["red", "green", "blue"]

of course no re-render will happen. If I chance the colors and they get resetted –> again no re-render. that’s the behaviour I want but i need the initial colors from the store.

i wanted to have only minimal necesarry re-renders

Is Google Picker API affected with deprecation of client side javascript libraries?

I am looking to implement Google Picker modal into my product. However, while I was going through the documentation, I came across a page which mentions that the JS libraries are being deprecated.

Here’s an article.

Since google’s official documentation for picker shows the usage of these deprecated libraries, I am confused whether to use the code or not – given they didn’t explicitly mentioned on picker documentation about deprecation.

However, since it’s using below two libraries, it seems it wouldn’t be ideal to follow the picker doc.

<script async defer src="https://apis.google.com/js/api.js" onload="onApiLoad()"></script> <script async defer src="https://accounts.google.com/gsi/client" onload="gisLoaded()"></script>

Please help me understand what alternative approach I can use to implement the picker?

I tried the code from picker documentation and it works fine, however I am concerned if it is ideal to use it.

Getting issue for selection dynamic slot duration in fullcalander

I want to display slot duration dynamically for day because we are using fullcalander for booking the volleyball court bases on hours like 10 to 23.

And I want to set the slot duration for 10 to 03:00 for 1 hour,03 to 23 of 1:30 bases on different prices but I am not able to do this.

Use case is this because when we are using the select range hook there is time mismatching for start time and end time due to that i am not able to create event.In the second image i am clicking into 19:00 to 20:30 slot but with select range i was getting 18:00 to 19:00 which is incorrect.[enter image description here](https://i.sstatic.net/4aSRhbTL.png)

I want to know how to fix slot duration issue

Summernote filtering out page tags for DOCTYPE head and body

i’m trying to get summernote to display a full webpage in the editor (technically it is an email template), but it keeps clearing out the <!DOCTYPE> and tags which is breaking the page.

Scripts/Styles:

<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>

<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous" />
<script type="text/javascript" src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>

<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/summernote-bs4.min.css" rel="stylesheet" />
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/[email protected]/dist/summernote-bs4.min.js"></script>

HTML:

<textarea name="summerEditor1" rows="2" cols="20" id="summerEditor1" class="textbox-textbox" style="display: none;">
&lt;!DOCTYPE html&gt;
&lt;html lang="en" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:v="urn:schemas-microsoft-com:vml"&gt;
    &lt;head&gt;
        &lt;title/&gt;
        &lt;meta content="text/html; charset=utf-8" http-equiv="Content-Type"/&gt;
        &lt;meta content="width=device-width, initial-scale=1.0" name="viewport"/&gt;
        &lt;!--[if mso]&gt;&lt;xml&gt;&lt;o:OfficeDocumentSettings&gt;&lt;o:PixelsPerInch&gt;96&lt;/o:PixelsPerInch&gt;&lt;o:AllowPNG/&gt;&lt;/o:OfficeDocumentSettings&gt;&lt;/xml&gt;&lt;![endif]--&gt;
    &lt;/head&gt;
    &lt;body style="background-color: #ffffff; margin: 0; padding: 0; -webkit-text-size-adjust: none; text-size-adjust: none;"&gt;
        &lt;!-- Start --&gt;
        Content Goes Here
        &lt;!-- End --&gt;
    &lt;/body&gt;
&lt;/html&gt;
</textarea> 

Initialize:

<script type="text/javascript">
    $(document).ready(function () {
        $('#summerEditor1').summernote({
        width: 685,
        height: 600,
        toolbar: [
            ['style', ['style']],
            ['font', ['bold', 'underline', 'clear']],
            ['color', ['color']],
            ['para', ['ul', 'ol', 'paragraph']],
            ['table', ['table']],
            ['insert', ['link', 'picture']],
            ['view', ['fullscreen', 'codeview', 'help']]
        ]
    });
});
</script>

Result:
Viewing source shows the DOCTYPE head and body tags removed, but title and meta and some hidden outlook tags remain just fine.

Source of Summernote WYSIWYG

I can’t find anywhere in the docs or even the source code of summernote where it filters out specific elements. I understand perhaps for security or XSS it may do this, but for my purposes I don’t have this editor available to public anyways, so if I could override it somehow, I would.

Can’t get iframe video to display fullscreen on Android browser

I’m having an issue with getting a video in an iframe to display in fullscreen on Android browsers only, as well as a problem with the video autoplaying. Here’s the snippet that I’m including in a dialog:

<iframe width="640" height="360" src="https://player.vimeo.com/video/591370010?h=ff1a0a3c7d&amp;title=0&amp;byline=0&amp;portrait=0&amp;playsinline=0" frameborder="0" allow="autoplay; fullscreen; picture-in-picture" mozallowfullscreen webkitallowfullscreen allowfullscreen></iframe>

I’m following MDN documentation related to the iframe‘s allowfullscreen property. I’ve also attempted various changes to the allowfullscreen properties:

mozallowfullscreen="" webkitallowfullscreen="" allowfullscreen="" 

mozallowfullscreen="true" webkitallowfullscreen="true" allowfullscreen="true" 

None of these trigger the iframe into fullscreen mode on Android browsers.

For the autoplay part of the issue, I’m following Vimeo’s documentation for playback on mobile by adding ?playsinline=0 to the end of the video src param.

This code words on iOS Safari, but not in Chrome on the Galaxy S20 and Pixel 4 devices I’ve tested. Do Android browsers have an inherent bug with this?

How do I make my Next and Previous buttons move this carousel? I already got it to slide transition automatically, but can’t get manual navigation

I am trying to make a carousel for our company LMS homepage. I want it to automatically transition through each carousel item (the banner images) as well as have it so people can click buttons to navigate back or forward through the carousel items without breaking the automatic timer. I have the automatic slide transitioning working and I have the buttons built for manually navigating. I just can’t figure out how to make the buttons work.
I am not too experienced with Javascript and I am guessing that is what I need to get this all working. So, if anyone could help me figure this out, I’d be eternally grateful!

My entire code is below for reference:

<!DOCTYPE html>
<html>
<head>
    <link tabindex="11" rel="preconnect" href="https://fonts.googleapis.com">
    <link tabindex="11" rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link tabindex="11" href="https://fonts.googleapis.com/css2?family=Roboto+Condensed:wght@300&display=swap" rel="stylesheet">
    <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
    <style>
    * {box-sizing: border-box}
    body {
    font-family: "Open Sans"; 
    margin:0; 
    white-space: nowrap;

    }


    * {
    margin: 0;
    padding: 0;
    }

    .carousel_items {
    display: flex;
    overflow: hidden;
    }


    .carousel_item {
    position: relative;
    min-width: 100%;
    max-width: 100%;
    height: 200px;
    transition: all 0.5s linear;
    background-repeat: no-repeat;
    background-size: cover;


    }
    .carousel_text {
    color: #f2f2f2;
    font-size: 4vh;
    padding: 8px 12px;
    position: absolute;
    bottom: 70px;
    width: 26%;
    text-align: center;
    background-color: none;
    font-family: "Open Sans";
    font-size: calc(1.5rem + 0.3vw);


    }

    .item1 {
    background-image: url("https://images.unsplash.com/photo-1707218526479-91d005196060?q=80&w=2070&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D");

    }
    .item2 {
    background-image: url("https://images.unsplash.com/photo-1435527173128-983b87201f4d?q=80&w=2067&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D");
    }
    .item3 {
    background-image: url("https://images.unsplash.com/photo-1523655223303-4e9ef5234587?q=80&w=2074&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D");
    }



    .prev, .next {
    cursor: pointer;
    position: absolute;
    top: 10%;
    width: auto;
    padding-top: 30px;
    padding-bottom: 30px;
    padding-right: 15px;
    padding-left: 15px;
    margin-top: -40px;
    color: white;
    font-weight: bold;
    font-size: calc(1.5rem + 0.3vw);
    transition: 0.6s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
    }


    .next {
    right: 0;
    border-radius: 3px 0 0 3px;
    }

    .prev:hover, .next:hover {
    background-color: rgba(0,0,0,0.8);
    }


    @media only screen and (max-width: 300px) {
    .prev, .next,.text {font-size: 11px}
    }


        
</style>
</head>
<body>

    
    <div class="carousel-container">
  <div class="carousel_items">
    <div class="carousel_item item1">
      <p class="carousel_text">Featured Training</p>
    </div>
    <div class="carousel_item item2">
      <p class="carousel_text">Activity Calendar</p>
    </div>
    <div class="carousel_item item3">
      <p class="carousel_text">Technical Learning</p>
    </div>
    
  </div>
    <a class="prev" onclick="plusSlides(-1)"><i class="material-icons">chevron_left</i></a>
        <a class="next" onclick="plusSlides(1)"><i class="material-icons">chevron_right</i></a> 
        
</div>

    
    </body>
    
    
    
<script>
    const carouselItems = document.querySelectorAll(".carousel_item"); 
let i = 1;

setInterval(() => {
 Array.from(carouselItems).forEach((item,index) => {
   if(i < carouselItems.length){
    item.style.transform = `translateX(-${i*100}%)`
   }
  })

    
  if(i < carouselItems.length){
    i++;
  }
  else{
    i=0;
  }
},4000)
    
    

    </script>



</html> 

I’ve tried adding triggers to the buttons but I just am far too inexperienced with Javascript. Trying to implement other people’s javascript codes for navigation buttons was too hard to get to work as well. So, I never really got anywhere.