我想添加一个按钮,<hr>为quill.js(beta)编辑器添加一个标签.
这里小提琴.
<!-- Initialize Quill editor -->
<div id="toolbar-container">
<span class="ql-formats">
<button class="ql-hr"></button> //here my hr-button
</span>
<span class="ql-formats">
<button class="ql-bold"></button>
<button class="ql-italic"></button>
</span>
</div>
<div id="editor">
<p>Hello World!</p>
<hr> // this gets replaced by <p> tag automatically *strange*
<p>Some initial <strong>bold</strong> text</p>
</div>
Run Code Online (Sandbox Code Playgroud)
我初始化我的编辑器:
var quill = new Quill('#editor', {
modules: {
toolbar: '#toolbar-container'
},
placeholder: 'Compose an epic...',
theme: 'snow'
});
Run Code Online (Sandbox Code Playgroud)
在这里,我<h1>为我的编辑器添加了一个标签功能,它非常有效:
$('.ql-hr').on("click",function(){
var range = quill.getSelection();
var text = …Run Code Online (Sandbox Code Playgroud) 当我使用预定义的友好名称从https://www.twilio.com/user/account/developer-tools/api-explorer/message-create发送测试短信时,它不会出现在我的手机上。我只看到数字。- 如果这是不可能的,您知道其他具有此功能的提供商吗?
我不想使用Vue-Material或Vuetify。
我想使用Materialize。我要做的是:
npm install materialize-css@next
Run Code Online (Sandbox Code Playgroud)
在main.js中,定义了我的新Vue App的地方,我像这样导入Materialize:
import 'materialize-css'
Run Code Online (Sandbox Code Playgroud)
javascript可以正常工作,但是CSS无法加载;我用Card Reveal进行测试。
交换动画有效,但未设置样式。Card Reveal是我要使用MaterializeCss的原因之一,而其他两个都不提供此功能。而且我还想使用“普通” HTML元素,而不是使用100个新元素(例如,在vuetify中)。
我有一个文件输入:
<input type="file" id="myImageInput" accept="image/*">
Run Code Online (Sandbox Code Playgroud)
我有一个预览 img:
<img src="http://myImageUrl" id="myImagePreview">
Run Code Online (Sandbox Code Playgroud)
我想将图像设置为 file-input#myImageInput 的文件。
我的尝试:
- 从 img#myImagePreview 创建 Base64:
function toDataUrl(url, callback) {
var xhr = new XMLHttpRequest();
xhr.onload = function() {
var reader = new FileReader();
reader.onloadend = function() {
callback(reader.result);
}
reader.readAsDataURL(xhr.response);
};
xhr.open('GET', url);
xhr.responseType = 'blob';
xhr.send();
}
let base64Image;
toDataUrl("http://myImageUrl",function(x){
base64Image = x;
})
Run Code Online (Sandbox Code Playgroud)
- 创建 DataTransfer 并将 base64Image 添加到其中:
const dT = new ClipboardEvent('').clipboardData || // Firefox < 62 workaround exploiting https://bugzilla.mozilla.org/show_bug.cgi?id=1422655
new DataTransfer(); // specs …Run Code Online (Sandbox Code Playgroud) 我的简单 docker-compose.yaml 文件:
version: '3'
services:
website:
image: php:7.4-cli
container_name: php72
volumes:
- .hi:/var/www/html
ports:
- 8000:80
Run Code Online (Sandbox Code Playgroud)
在文件夹 hi/ 中,我只有一个 index.php,其中包含 hello world 打印内容。(我这里还需要一个 Dockerfile 吗?)
现在我只想用 docker compose up 运行这个容器:
$ docker compose up
host path ("/Users/xy/project/TEST/hi") not allowed as volume source, you need to reference an Azure File Share defined in the 'volumes' section
Run Code Online (Sandbox Code Playgroud)
“docker compose”与 Azure 有什么关系?- 我目前不想使用 Azure 文件共享,并且我从未提及或配置过 Azure 的任何内容。我使用 $az logout 退出了 azure,但在我的 macbook 上仍然出现这个奇怪的错误。
我在HTML中有2个字段:
<input id="datum" type="date">
<input id="uhrzeit" type="time">
Run Code Online (Sandbox Code Playgroud)
JavaScript:
var datumUhrzeit = new Date($("#datum").val()+","+$("#uhrzeit").val());
console.log(datumuhrzeit);
"Tue Aug 18 2015 16:45:00 GMT+0200 (Mitteleuropäische Sommerzeit)"
Run Code Online (Sandbox Code Playgroud)
如何将PHP中的“ Tue Aug 18 2015 16:45:00 GMT + 0200(MitteleuropäischeSommerzeit)”转换为DateTime,以便将其保存到postgresql?
我在Android中有这个TabLayout,并希望使标签比默认值更高(48dp)
<android.support.design.widget.TabLayout
android:id="@+id/contentTabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/Theme.Zhaw.TabLayout"
app:tabMode="fixed"
app:tabGravity="fill"/>
Run Code Online (Sandbox Code Playgroud)
这是Style Theme.Zhaw.TabLayout:
<style name="Theme.Zhaw.TabLayout" parent="Widget.Design.TabLayout">
<item name="tabIndicatorColor">@color/text_white</item>
<item name="tabIndicatorHeight">4dp</item>
<item name="tabPaddingStart">6dp</item>
<item name="tabPaddingEnd">6dp</item>
<item name="tabBackground">@color/colorPrimary</item>
<item name="tabTextAppearance">@style/Theme.Zhaw.TabLayoutText</item>
<item name="tabSelectedTextColor">@color/text_white</item>
</style>
Run Code Online (Sandbox Code Playgroud)
tabIndicatorHeight可以设置选项卡中小指示符(活动选项卡)的高度.但是我们如何设置标签本身的高度呢?
消息:您的 SQL 语法有错误;检查与您的 MariaDB 服务器版本相对应的手册,了解在“country_of_residence_id”附近使用的正确语法 INTEGER NOT NULL 声明:ALTER TABLE address ALTER COLUMN 'country_of_residence_id' INTEGER NOT NULL
在我的表 'address' 中,我想将一个已经存在的列 'country_of_residence_id' 设置为 NOT NULL。
我是这样试的:
ALTER TABLE address
ALTER COLUMN 'country_of_residence_id' INTEGER NOT NULL;
Run Code Online (Sandbox Code Playgroud)
我的 IDE 在 INTEGER 下划线并说:DROP 或 SET 预期,得到“INTEGER”
当我在 INTEGER 之前添加 SET 时它也不起作用。
我没有收到任何错误。该文件夹uploads有chmod 777.
后端:
var multer = require('multer');
var storage = multer.diskStorage({
destination: function (req, file, cb) {
cb(null, './uploads')
},
filename: function (req, file, cb) {
cb(null, file.fieldname + '-' + Date.now())
}
});
var upload = multer({ storage: storage,
limits: { fileSize: '50mb' }}).single('photo');
router.post('/bild',function(req,res){
console.log("REQ",req); //file is there in the body
upload(req,res,function(err) {
if(err) {
return res.end("Error uploading file.");
}
res.end("File is uploaded");
});
});
Run Code Online (Sandbox Code Playgroud)
前端:
$("#formular").submit(function (e) {
e.preventDefault();
var form = $(this)[0]; …Run Code Online (Sandbox Code Playgroud) 我尝试强制我在 heroku 上托管的 Sails.js WebApp(未安装 nginx)从 http:// 到 https:// 并在我的 Sailing.js 应用程序中使用这个express 中间件:
在 Express 中,它看起来像这样:
app.use(forceDomain({
hostname: 'www.example.com',
port: 4000,
protocol: 'https'
}));
Run Code Online (Sandbox Code Playgroud)
我尝试在我的 Sails.js 应用程序的 config/http.js 文件中使用它:
middleware: {
forceDomain: function (req, res, next) {
forceDomain({
hostname: 'www.myurl.com',
port: 4000,
protocol: 'https'
});
next();
},
order: [
'forceDomain',
...
}
Run Code Online (Sandbox Code Playgroud)
我不明白如何在sails.js 中使用这个“app.use()”这个东西。据这里解释,但我真的不明白。我现在所拥有的不起作用(没有错误,但也没有重定向)。我怎样才能解决这个问题?
安装了这个模块- 也不起作用。
我使用Moment.js
var created = moment("24.07.2015 16:09:05", "DD.MM.YYYY hh:mm:ss");
var expire= created.add(7, 'days');
var countdown = expire.fromNow();
Run Code Online (Sandbox Code Playgroud)
var countdown为我提供了"3天内"的字符串 - 但是如何在没有字符串"in days"的情况下,只能在几天或几小时内获得一个数字.我想做一个比较并用不同的颜色标记倒计时,当它小于7,或4或1天时.
var personsWrapper = driver.findElement(By.className('_class1 _class2'));
personsWrapper.findElements(By.tagName('button')).then(function (persons_arr) {
console.log("length:", persons_arr.length);
persons_arr.forEach(function (p) {
var x = p.getAttribute("value");
console.log(x)
})
});
Run Code Online (Sandbox Code Playgroud)
当我尝试这个时,我在控制台上得到一个 ManagedPromise 对象而不是按钮的值 - 为什么?