Skip to content

Instantly share code, notes, and snippets.

@igotit-anything
igotit-anything / local-image-show.js
Last active Aug 26, 2016
JavaScript. Local Image Show
View local-image-show.js
<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 Aug 27, 2016
JavaScript. CKEditor plugin init codes. - example : Cy-GistInsert's plugin.js
View 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 Aug 27, 2016
JavaScript. CKEditor plugin Dialog basic code. - example: Cy-GistInsert's dialogs/Cy-GistInsertDlg.js
View 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 Aug 28, 2016
JavaScript. CKEditor plugin init codes with context menu. - example : Cy-GistInsert's plugin.js
View 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 Aug 28, 2016
JavaScript. CKEditor plugin Dialog basic code with context menu. - example: Cy-GistInsert's dialogs/Cy-GistInsertDlg.js
View 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 Sep 3, 2016
CKEditor. apply my own css file not default contents.css.
View CKEditor_contentsCss.js
<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 Sep 5, 2016
CKEditor Vertical Scrollbar always shown. add this to contents.css
View contents.css
.cke_show_borders {
overflow-y: scroll; // vertical scrollbar
// overflow-x: scroll; // horizontal scrollbar
}
View rss.xml
<?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 Sep 5, 2016
notice to web browser "this site has a rss"
View notice_rss_to_browser.htm
<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 Sep 5, 2016
JavaScript. get utc time.
View getutc.js
<script language="javascript">
function js_time()
{
var today = new Date();
return today.toUTCString();
}
</script>
// if in asp