Skip to content

Instantly share code, notes, and snippets.

//Ckedit 定制!隐藏finder链接和图像,并设定默认值 for drupal
if(typeof(CKEDITOR) === 'object')
CKEDITOR.on( 'dialogDefinition', function( ev )
{
// Take the dialog name and its definition from the event
// data.
var dialogName = ev.data.name;
var dialogDefinition = ev.data.definition;
// Check if the definition is from the dialog we're
@guoxiangke
guoxiangke / gist:8996525
Created February 14, 2014 06:10
iFrame: How to show specific part of a webpage using iframe
<div style="overflow: hidden; margin: 15px auto; max-width: 671px;">
<iframe scrolling="no" src="http://www.tudou.com/programs/view/CsD3k0zPQuU" style="border: 0px none; margin-left: 0px; height: 2354px; margin-top: -853px; width: 926px;">
</iframe>
</div>
<?php
//drupal7 迁移评论 某个节点的
//dpm(comment_load(381));
$comments = array();
for($i=0;$i<500;$i++) {
$comment = comment_load($i);
if($comment && $comment->nid == '3') {
$comment->nid = '486';
$comment->node_type = 'comment_node_page';
unset($comment->rdf_data);
@guoxiangke
guoxiangke / syfmony1
Created March 7, 2014 06:53
syfmony安装记录1
//syfmony安装记录1
composer create-project symfony/framework-standard-edition . 2.4.2
Installing symfony/framework-standard-edition (v2.4.2)
- Installing symfony/framework-standard-edition (v2.4.2)
Downloading: 100%
Created project in .
Loading composer repositories with package information
Installing dependencies (including require-dev)
- Installing jdorn/sql-formatter (v1.2.17)
@guoxiangke
guoxiangke / drupal node created
Created April 16, 2014 23:34
按顺序创建365个节点
$time = strtotime('2014-01-01 00:00:00+00:00');
dpm(date('Y-m-d 00:00:00+00:00',$time));
$i=date('z');
dpm($i);
$nodes = array();
for($i;$i<=365;$i++) {
$created =$time + $i* 86400;
$node = new stdClass();
$node->uid = '1';
$node->type = 'grace365';
@guoxiangke
guoxiangke / druedu_notifications.js
Created April 26, 2014 00:11
druedu_notifications.js
jQuery(function($){
function drueduNotificationsAjaxSubmit() {
$( ".notifications-ajax li a" ).each(function(){
if($(this).hasClass('btn-small')) {
$(this).removeClass('btn-small');
}
$(this).addClass('btn btn-mini');
});
@guoxiangke
guoxiangke / drupal_form_ajax_check.js
Created May 4, 2014 09:22
ajax node form submit ,check before submit
(function ($) {
Drupal.behaviors.confirm = {
attach: function(context, settings) {
var events = $('.node-weibo-form input[name=op]').data('events'); // Get the jQuery events.
$('.node-weibo-form input[name=op]').unbind('mousedown'); // Remove the click events.
var name = $('.node-weibo-form input[name=title]').val();
$('.node-weibo-form input[name=op]').mousedown(function () {
// var events = $('.node-weibo-form input[name=op]').clone(true).data('events');// Get the jQuery events.
@guoxiangke
guoxiangke / overlay,js
Created May 22, 2014 02:59
js弹出层
<div class="contact_card" id="contact_card_guo" style="display:none; position:relative; z-index:99999;">
<div class="box" id="guo-hide">
<div id="guo-show">
<p><b class="f20"><?php print t("You need to be logged in order to submit your enquiry.");?></b></p>
<div class="btn_login"><a href="<?php print url('user/register');?>" class="btn_orange"><?php print t('Sign up, it\'s free');?></a></div>
<div class="btn_login"><a href="#TB_inline?height=360&width=420&inlineId=loginbox" class="btn_orange thickbox"><?php print t('Login');?></a></div>
<div id="contact_card_guo_close"><a href="#" id="TB_closeWindowButton">close</a></div>
</div>
</div>
@guoxiangke
guoxiangke / 20150526.js
Created May 26, 2014 03:45
chrome firefox input radios click auto submit
<script type="text/javascript">
$(document).ready(function(){
$("#webform-client-form-1363 .form-actions .form-radios label").live('click',function(e){//.click(function(){
e.preventDefault();
$(this).children('input').attr('checked','checked');
// console.log('click');
$("#webform-client-form-1363 .form-actions input[type=submit]").trigger("click");
});
})
</script>
@guoxiangke
guoxiangke / weixin node create book!
Created May 30, 2014 22:58
weixin node create book!
$books = array(
'0'=>'http://mp.weixin.qq.com/mp/appmsg/show?__biz=MjM5NjQwMDE2Mw==&appmsgid=10000251&itemidx=1&sign=52b2980fca36785ca3671575fa1cb098#wechat_redirect',
'1'=>'http://mp.weixin.qq.com/mp/appmsg/show?__biz=MjM5NjQwMDE2Mw==&appmsgid=10000251&itemidx=2&sign=b7e8cc04c531fc07a953d39c62411c08#wechat_redirect',
'2'=>'http://mp.weixin.qq.com/mp/appmsg/show?__biz=MjM5NjQwMDE2Mw==&appmsgid=10000251&itemidx=3&sign=df465908982990d92306ac649b9a663e#wechat_redirect',
'3'=>'http://mp.weixin.qq.com/mp/appmsg/show?__biz=MjM5NjQwMDE2Mw==&appmsgid=10000251&itemidx=4&sign=7d98347febbe2707d887f49bf8cddfff#wechat_redirect',
'4'=>'http://mp.weixin.qq.com/mp/appmsg/show?__biz=MjM5NjQwMDE2Mw==&appmsgid=10000251&itemidx=5&sign=547baf5c8b15297f80b4737a04f9ccf7#wechat_redirect',
'5'=>'http://mp.weixin.qq.com/mp/appmsg/show?__biz=MjM5NjQwMDE2Mw==&appmsgid=10000251&itemidx=6&sign=e7e45471b60e5ab7a0624f8b99b2e3a6#wechat_redirect',
'6'=>'http://mp.weixin.qq.com/mp/appmsg/show?__biz=MjM5NjQwMDE2Mw==&appmsgid=10000251&itemidx=7&