几个小问题记录一下
Install the latest cumulative IE update :
http://www.microsoft.com/en-us/download/details.aspx?id=45134 (32 bit)
http://www.microsoft.com/en-us/download/details.aspx?id=45154 (64 bit)
膘叔的简单人生
几个小问题记录一下
Install the latest cumulative IE update :
http://www.microsoft.com/en-us/download/details.aspx?id=45134 (32 bit)
http://www.microsoft.com/en-us/download/details.aspx?id=45154 (64 bit)
尝试整个vue+tinymce的时候遇到点问题(之前说过,本来是用quillJS的。但如果要发表的内容支持那些微信编辑器里复制过来的内容。quill自己定义过的一些虚拟DOM就不支持了)
希望是美好的,实现起来是麻烦的,最后我放弃所有的选项,改用弹框iframe的形式。然而,问题就这么来了,tinymce5的dialog居然不支持iframe了。比如你看这个:https://github.com/tinymce/tinymce/issues/4786,官方直接说不支持了。NND
不过有人提示说,可以利用htmlpanel,直接在htmlpanel的html标签里,用<iframe。。。然后我试了一下。。居然真的OK
好吧,直接参考 这个了!https://github.com/tinymce/tinymce/issues/4786#issuecomment-463827289
JS文件:
function FileManager(callback, value, meta) {
var windowManagerURL = "/FilManage";// filemanager path
var windowManagerCSS = '<style type="text/css">' +
'.tox-dialog {max-width: 100%!important; width:97.5%!important; overflow: hidden; height:95%!important; border-radius:0.25em;}' +
'.tox-dialog__header{ display:none!important; }' +// for custom header in filemanage
'.tox-dialog__footer { display: none!important; }' +// for custom footer in filemanage
'.tox-dialog__body { padding: 0!important; }' +
'.tox-dialog__body-content > div { height: 100%; overflow:hidden}' +
'</style > ';
window.tinymceCallBackURL = '';
window.tinymceWindowManager = tinymce.activeEditor.windowManager;
tinymceWindowManager.open({
title: '',
body: {
type: 'panel',
items: [{
type: 'htmlpanel',
html: windowManagerCSS+ '<iframe src="' + windowManagerURL + '" frameborder="0" style="width:100%; height:100%"></iframe>'
}]
},
buttons: [] ,
onClose: function () {
if (tinymceCallBackURL!='')
callback(tinymceCallBackURL, {}); //to set selected file path
}
} );
}
iframe中:
var windowManager = top != undefined && top.tinymceWindowManager != undefined ? top.tinymceWindowManager : '';
if (windowManager != '') {
if (top.tinymceCallBackURL != undefined)
top.tinymceCallBackURL = path;
windowManager.close();
}
基于昨天写的vue+blade+(vue-pjax-adapter),发现没有任何进度提示,感觉比较不直观,但vue-pjax-adapter不能注入方法(或许是我不会)。
window.axios.interceptors.request.use((config) => {
console.log(before);
NProgress.configure({easing: 'ease', speed: 1000, showSpinner: true});
NProgress.start();
return config;
});
window.axios.interceptors.response.use((response) => {
NProgress.done();
console.log(after);
return response;
}, (error) => {
return Promise.reject(error);
});
import nPjaxAdapter from 'vue-nprogress-pjax';
window.Vue.use(nPjaxAdapter);
/**
* 如果不是标准的pjax-container,就是这样使用
* // window.Vue.use(nPjaxAdapter, {
// targetSelector: '#my-custom-target',
// });
*/
就这样简单。现在切换页面有进度条了
放到javascript里为实在是意外 。主要是这应该是属于前端的事情。
<form>
<input type='hidden' value='0' name='selfdestruct'>
<input type='checkbox' value='1' name='selfdestruct'>
</form>
jqweui是一个偷懒的基于Weui的组件,1.0的时候已经部分支持rem。所以用的还是比较多的。特别是我对它的部分组件有了一些扩展。而且它还有一些奇技淫巧。
1、如何通过函数来动态调整picker的内容。
默认情况下,picker/select在初始化的时候值已经固定了。这时候你其实是没有办法调整的,但不代表没有办法。虽然 API里没有提供,读了源码后你就能发现。其实你可以这样:
$('#xxx').val('').data('weui-select',false).select({
title: "其他值",
items: ["1","2"]
});
记得有一个恶心的地方,items里的值不能是数字!!!
2、添加清除功能,默认的select/picker在选择后就不能清除了(当然你可以在items的第一个值设置为空)。所以我简单的扩展了一下:https://github.com/lihongxun945/jquery-weui/issues/443。
无非就是加个文字,加个清除等等。。
3、picker/select在使用的时候,有时候会显示一个软键盘而无法删除和隐藏。这时候的解决办法其实就是在input上面加上onfocus="this.blur()"即可!
说实话,在datatables里,我觉得这个回复挺重要的!https://datatables.net/forums/discussion/33723/new-user-help-columns-vs-columndefs-for-client-side-rendering-of-ajax-data
Hi,
I'm a beginner with DataTables. I'm trying to use DataTables AJAX to pull records from the server (an ASP.NET MVC app.) Each record coming from the server has name, address line 1, address line 2, city, state, zip. I want my table to combine and format all those fields into one column on the client.
My questions are:
1. Would I use columns.render, or columnDefs.render?
2. Do I need both columns and columnDefs?
3. Do I need to specify either the table column name (e.g., NameAndAddress) in "columns", or do I need to list each field coming back from the server?
4. How do I use "targets"? Does "targets" refer to the column in the displayed table, or the column under "columns"?
Thanks for your help. I've been though the documentation a few times and I'm still confused about columns vs. columnDefs.
"columns" & "columnsDefs" ultimately serve the same purpose.
The differences being:
"targets" takes a single string or int value, or array of previous two to denote which columns this configuration is for. I suggest using column class instead of column # in the event you want to use ColReorder extension.
Here are examples of how I have configured columns in my application.
<th class="actionsCol no-print">Actions</th>
<th class="StatusCol">Status</th>
<th class="IsFinalCol">Final<br>Plan</th>
<th class="VrsnCol">Vrsn</th>
<th class="CutCntCol">Cut<br>Cnt</th>
<th class="CarCntCol">Car<br>Cnt</th>
"columnDefs": [
{
// This is for the Action column icons
"targets": 'actionsCol',
"sorting": false,
"orderable": false,
"type":"html",
"width": "8%",
className: "dt_nowrap_col no-print",
"render": function (data, type, row) {
return $.jqote(yv.templates.action_icons, data);
}
},
{
"targets": ['IsFinalCol','CutCntCol','CarCntCol','VrsnCol','StatusCol'],
"width": "5%"
},
etc
]
datatables现在也开始逐步用的多了。虽然用起来复杂了一点,但好歹还能减少一些开发量
nestable在点击的时候,有一个拖动的状态被触发,会导致你给nestable上加的链接都会无效。
select的placeholder其实是无效的。所以很多人想了一些奇技淫巧,比如利用HTML的标签:
<select>
<option value="" disabled selected hidden>Please Choose</option>
<option value="0">Open when powered (most valves do this)</option>
<option value="1">Closed when powered, auto-opens when power is cut</option>
</select>
<select prompt="Plaese Choose">
<option value="0"> 0 </option>
<option value="1" 1 </option>
</select>
if (isset($tagOptions['prompt'])) {
$prompt = $encode ? static::encode($tagOptions['prompt']) : $tagOptions['prompt'];
if ($encodeSpaces) {
$prompt = str_replace(' ', ' ', $prompt);
}
$lines[] = static::tag('option', $prompt, ['value' => '']);
}
他自己实现了这么一条空信息,我没细看,对不住各位
不多说,直接上代码,其实就是让Facybox支持手指滑动。。。fancybox3已经支持了,不过他的样式太丑了。。这个的样式设计的有点象微信。。。有意思
$(document).ready(function() {
$('.js-fancybox').fancybox({
width: "100%",
margin: [0, 0, 0, 0],
padding: [0, 0, 0, 0],
openEffect : 'none',
closeEffect : 'none',
prevEffect : 'fade',
nextEffect : 'fade',
closeBtn : false,
arrows: false,
helpers : {
title : null,
overlay : {
css : {
'background' : 'rgba(0, 0, 0, 0.95)'
}
},
buttons : {
}
},
afterShow: function() {
$('.fancybox-wrap').swipe({
swipe : function(event, direction) {
if (direction === 'left' || direction === 'up') {
$.fancybox.prev( direction );
} else {
$.fancybox.next( direction );
}
}
});
},
afterLoad : function() {
}
});
});
原文地址参考 :http://codepen.io/frontendstudio/pen/cixjm