Skip to content

Instantly share code, notes, and snippets.

@igotit-anything
igotit-anything / local-image-show.js
Last active August 26, 2016 17:49
JavaScript. Local Image Show
<script>
var loadFile = function(event) {
var output = document.getElementById('id_viewimg');
output.src = URL.createObjectURL(event.target.files[0]);
};
</script>
<input type="file" onchange="loadFile(event)"/>
<img id="id_viewimg" src="images/photo.gif" name="preview" border="0" />
@igotit-anything
igotit-anything / plugin.js
Created August 27, 2016 12:04
JavaScript. CKEditor plugin init codes. - example : Cy-GistInsert's plugin.js
CKEDITOR.plugins.add( 'Cy-GistInsert', {
icons: 'Cy-GistInsert',
init: function( editor ) {
editor.addCommand( 'cmd-insertgist1', { // adding the command
exec: function( editor ) {
editor.insertHtml( 'Test from plugin Cy-GistInsert cmd-insertgist1 ' ); // at now just testing purpose.
}
});
editor.ui.addButton( 'Cy-GistInsert', {
label: 'Insert GitHub Gist', // button's tooltip text.
@igotit-anything
igotit-anything / Cy-GistInsertDlg.js
Last active August 27, 2016 17:51
JavaScript. CKEditor plugin Dialog basic code. - example: Cy-GistInsert's dialogs/Cy-GistInsertDlg.js
/*
file name : Cy-GistInsertDlg.js
CKEditor Plugin "Cy-GistInsert" Dialog
by igotit. 2016-08-28.
*/
CKEDITOR.dialog.add('Cy-GistInsertDlg', function (editor) {
return {
title: 'Cy-GistInsert', // text shown titlebar.
minWidth: 400,
@igotit-anything
igotit-anything / plugin.js
Created August 28, 2016 14:34
JavaScript. CKEditor plugin init codes with context menu. - example : Cy-GistInsert's plugin.js
/*
CKEditor Plugin
name : Cy-GistInsert.
2016-08-27.started by igotit.
*/
CKEDITOR.plugins.add( 'Cy-GistInsert', {
icons: 'Cy-GistInsert',
init: function( editor ) {
@igotit-anything
igotit-anything / Cy-GistInsertDlg.js
Created August 28, 2016 14:36
JavaScript. CKEditor plugin Dialog basic code with context menu. - example: Cy-GistInsert's dialogs/Cy-GistInsertDlg.js
/*
file name : Cy-GistInsertDlg.js
CKEditor Plugin "Cy-GistInsert" Dialog
2016-08-28. started by igotit.
*/
CKEDITOR.dialog.add('Cy-GistInsertDlg', function (editor) {
return {
title: 'Cy-GistInsert', // text shown titlebar.
@igotit-anything
igotit-anything / CKEditor_contentsCss.js
Last active September 3, 2016 12:26
CKEditor. apply my own css file not default contents.css.
<script>
CKEDITOR.replace('editor1',{
contentsCss: '../CSS/ckeditor_specific.css', // apply my own css. not default contents.css
width: 660, // contents width final web page(600) + editor margin(20)*2 + vertical scroll bar(20)
height: 500
});
</script>
// detail about contentsCss -> http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-contentsCss
@igotit-anything
igotit-anything / contents.css
Created September 5, 2016 05:28
CKEditor Vertical Scrollbar always shown. add this to contents.css
.cke_show_borders {
overflow-y: scroll; // vertical scrollbar
// overflow-x: scroll; // horizontal scrollbar
}
@igotit-anything
igotit-anything / rss.xml
Created September 5, 2016 11:11
RSS2.0 skeleton
<?xml version="1.0" ?>
<rss version="2.0">
<channel>
<title>my_title</title>
<link>http://my_url</link>
<description>my_description</description>
<item>
<title>my_item_title</title>
<link>http://my_item_link</link>
@igotit-anything
igotit-anything / notice_rss_to_browser.htm
Created September 5, 2016 11:22
notice to web browser "this site has a rss"
<head>
<link rel="alternate" type="application/rss+xml" href="http://my_url/rss.xml" title="title">
</head>
@igotit-anything
igotit-anything / getutc.js
Last active September 5, 2016 15:35
JavaScript. get utc time.
<script language="javascript">
function js_time()
{
var today = new Date();
return today.toUTCString();
}
</script>
// if in asp