frontend

I'm creating an html template that looks like windown but have problems with the resizers

老子叫甜甜 提交于 2019-12-13 03:27:44
问题 I'm creating an windown look like template for web but I have a problem with the resizer, the resizer in the bottom right works perfectly but trying to create the top right resizer don't work and I don't know why I have tried everything but it doesn't work. Here's the github https://github.com/alhazacod/windowsxphtmltemplate The JavaScript code: dragru.onmousedown = function(event) { let shiftLeft = event.clientX - wwindow.getBoundingClientRect().left; let shiftTop = event.clientY - wwindow

setting data from route to controller error in Emberjs

醉酒当歌 提交于 2019-12-13 02:33:30
问题 i am a newbie in Emberjs.. I am trying to set data content from Emberjs route to controller to display in template.. i followed the suggestions here.. Access content inside a controller function ember works perfect.. but now i am getting this error Uncaught Error: Assertion Failed: The value that #each loops over must be an Array. You passed {items: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object], title: current mood} edit: here is also my code.

Wordpress upload frontend form not uploading images

孤人 提交于 2019-12-13 01:37:58
问题 I'm working on a frontend form in wordpress to create a custom post type and upload a picture attached to that post. Below is my code so far. The post is created, but problem is that the images are not uploaded to the server either attached to that post. On the other hand I would like the images to be pre-visualized before sending the form, in the same way wordpress works for the admin area. if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['new_cpt_action'] ) && $_POST['new_cpt

gulp.watch() not running subsequent task

我们两清 提交于 2019-12-13 01:19:32
问题 Running into a bizarre bug when trying to make modular gulp tasks by splitting them into separate files. The following should execute the task css , but does not: File: watch.js var gulp = require('gulp'); var plugins = require('gulp-load-plugins')(); gulp.task('watch', function () { plugins.watch('assets/styl/**/*.styl', ['css']); // PROBLEM }); Declaring ['css'] in plugins.watch() should technically run the following task next: File: css.js var gulp = require('gulp'); var plugins = require(

Multiple versions of same JS library with Bower and django-pipeline

半城伤御伤魂 提交于 2019-12-12 19:29:53
问题 Two of the libraries I use in my single page application are moment and backgrid-moment-cell. I use bower to manage my front-end libraries and django-pipeline for asset packaging. I'd like to use version 2.8.1 of moment, but backgrid-moment-cell requires version ~2.5.0. How can I get both version into my project? 回答1: Front-end development should use a single dependency because you want to minimize the amount of code your users need to download. Bower helps you to manage this, which is a

Enable datatable warning alert

别等时光非礼了梦想. 提交于 2019-12-12 19:18:09
问题 I wanted to stop the datatable warning alert before my js script start filling the datatable with data. So i added this line: //hide the warning $.fn.dataTable.ext.errMode = 'none'; But when that datatable is created and filled, i want to enable the warnings again again for the rest of datatables that are in my script. How can i do that? here is my code: //hide the warning $.fn.dataTable.ext.errMode = 'none'; //add rows $("#addRows").on("click", function () { table.clear(); for (idxT in

Drop down does not populate with API data in Angular

不问归期 提交于 2019-12-12 19:09:44
问题 I want to retrive data to dropdown from api and I don't know what is wrong in my code. Result of API : [{"projectId":2,"projectName":"test","gates":[]},{"projectId":3,"projectName":"project1","gates":[]}] Model of service( project.ts ) : export class Project{ projectName: string; projectId :number; } Dropdown in my sidebar.component.html : <div class="dropdown ml-auto"> <select (change)=selectedHandlerProjectName($event) class="btn btn-secondary dropdown-toggle" style="margin-left: -10px

Is there a way to apply characters limit inside wp_editor function?

。_饼干妹妹 提交于 2019-12-12 18:15:02
问题 I am trying to find out how to combine this code in resource box on a front end submission form but I need it to be limited to a certain number of characters. <?php wp_editor( get_option('resource'), 'resource', array('textarea_name' => 'resource', 'class'=>'requiredField', 'textarea_rows'=>'6','id'=>'resource' ,'onkeyup'=>'countChar(this)','media_buttons' => false) );?><?php if(isset($_POST['resource'])) { if(function_exists('stripslashes')) { echo stripslashes($_POST['resource']); } else {

Migrating Website from HTTP to HTTPS

戏子无情 提交于 2019-12-12 17:36:02
问题 I have to migrate a website from HTTP to HTTPS and keep user experience unchanged (no warning popups). What would be the front end main points to be verified? I realized I have to make sure all inclusions (CSS, images and JS) have to reference https content, but I'm still not sure about the a(link) href attribute and if there's anything I'm missing. 回答1: How to migrate to HTTPS is an excellent migration howto. The steps are: Get and install certificates Enable HTTPS on your servers Make intra

Why does Google hangouts support sharing desktop without Chrome Extension in latest Chrome?

为君一笑 提交于 2019-12-12 13:14:18
问题 As far as I know, in browser, such as Chrome, sharing desktop or application needs a Chrome Extension to work, eg: chrome.permissions.request({ permissions: ['desktopCapture'], } But why does Google Hangouts do not need any extension to capture desktop? Is there any API of JavaScript for this? 回答1: As of now, Google Hangouts does use an extension, it's just integrated into Chrome to the point of not being visible. Source: Chromium issue to remove this special treatment You can test that it is