'생활의 발견 > LIFE (일상다반사)' 카테고리의 다른 글
2013 추석연휴 고속도로 소통정보 (0) | 2013.09.17 |
---|---|
차례상 진설법, 지방쓰는 법 (0) | 2013.09.16 |
호갱 - 의미 (0) | 2013.06.13 |
빚을 줄이는 5가지 방법 (0) | 2013.05.29 |
전두엽을 활성화 시키는 방법을 아시나요? (0) | 2013.05.27 |
2013 추석연휴 고속도로 소통정보 (0) | 2013.09.17 |
---|---|
차례상 진설법, 지방쓰는 법 (0) | 2013.09.16 |
호갱 - 의미 (0) | 2013.06.13 |
빚을 줄이는 5가지 방법 (0) | 2013.05.29 |
전두엽을 활성화 시키는 방법을 아시나요? (0) | 2013.05.27 |
자동완성
jQuery.textcomplete is a jQuery plugin that adds an autocomplete feature to textareas, like the ones found in GitHub comment forms. It’s completely open source, released under the MIT license.
Introduces autocompleting power to textareas, like a GitHub comment form has.
Demo.
Note: The key words "MUST", "SHOULD", and "MAY" in this document are to be interpreted as described in RFC 2119.
jQuery MUST be loaded ahead.
<script src="path/to/jquery.js"></script>
<script src="path/to/jquery.textcomplete.js"></script>
Then jQuery.fn.textcomplete
is defined. The method MUST be called for textarea elements, and the receiver SHOULD include an element.
$('textarea').textcomplete(strategies);
The strategies
is an Object not an Array. Each value is called a strategy object and the corresponding key is the name of the strategy.
var strategies = {
// There are two strategies called 'foo' and 'bar.'
// The plugin does not care these property names so you should use
// meaningful names.
foo: strategy,
bar: otherStrategy
};
The strategy
is an Object which MUST have match
, search
and replace
and MAY have index
, maxCount
and template
.
var strategy = {
// Required
match: matchRegExp,
search: searchFunc,
replace: replaceFunc,
// Optional
index: indexNumber,
maxCount: maxCountNumber,
template: templateFunc,
cache: cacheBoolean
}
The matchRegExp
and indexNumber
MUST be a RegExp and a Number respectively. matchRegExp
MUST contain capturing groups and SHOULD end with $
. indexNumber
defaults to 2. The word captured by indexNumber
-th group is going to be the term
argument of searchFunc
.
// Detect the word starting with '@' as a query term.
var matchRegExp = /(^|\s)@(\w*)$/;
var indexNumber = 2;
The searchFunc
MUST be a Function which gets two arguments, term
and callback
. It MUST invoke callback
with an Array of String. It is guaranteed that the function will be invoked exclusively even though it contains async call.
If you want to execute callback
multiple times per a search, you SHOULD give true
to the second argument while additional execution remains. This is useful to use data located at both local and remote. Note that you MUST invoke callback
without truthy second argument at least once per a search.
The maxCountNumber
MUST be a Number and default to 10. Even if searchFunc
callbacks with large array, the array will be truncated into maxCountNumber
elements.
The cacheBoolean
MUST be a Boolean. It defaults to false
. If it is true
the searchFunc
will be memoized by term
argument. This is useful to prevent excessive API access.
var searchFunc = function (term, callback) {
// Show local cache immediately.
callback(cache[term], true);
$.getJSON('/search', { q: term })
.done(function (resp) {
// Resp must be an Array of String such as:
// ['hello', 'world']
callback(resp);
})
.fail(function () {
// Callback must be invoked even if something went wrong.
callback([]);
});
};
The templateFunc
MUST be a Function which gets and returns a string. The function is going to be called as an iteretor for the array given to the callback
of searchFunc
.
var templateFunc = function (value) {
return '<b>' + value + '</b>';
};
The replaceFunc
MUST be a Function which gets and returns a string. It is going to be invoked when a user will click and select an item of autocomplete dropdown.
var replaceFunc = function (value) { return '$1@' + value + ' '; };
The result is going to be used to replace the textarea's text content using String.prototype.replace
with matchRegExp
:
textarea.value = textarea.value.replace(matchRegExp, replaceFunc(value));
var emojies = ['+1', '-1', 'dog', 'cat'];
$('textarea').textcomplete({
// mention strategy
mention: {
match: /(^|\s)@(\w*)$/,
search: function (term, callback) {
callback(cache[term], true);
$.getJSON('/search', { q: term })
.done(function (resp) { callback(resp); })
.fail(function () { callback([]); });
},
replace: function (value) {
return '$1@' + value + ' ';
},
cache: true
},
// emoji strategy
emoji: {
match: /(^|\s):(\w*)$/,
search: function (term, callback) {
var regexp = new RegExp('^' + term);
callback($.map(emojies, function (emoji) {
return regexp.test(emoji) ? emoji : nil;
}));
},
replace: function (value) {
return '$1:' + value + ': ';
}
}
});
The HTML generated by jquery-textcomplete is compatible with Bootstrap's dropdown. So all Bootstrap oriented css files are available.
This repository also includes jquery.autocomplete.css. It is useful to be used as the starting point.
[jQuery] 모든 라디오버튼, 체크박스 클릭시 로그인하라는 경고 보여주시 (0) | 2013.09.13 |
---|---|
[jquery] 영문만, 숫자만, 한글만 입력. (0) | 2013.09.12 |
[jQuery] 40 Fresh jQuery Plugins To Make Your Website User Friendly (0) | 2013.09.12 |
[javascript] IE에서 문장 복사하기 (0) | 2013.09.11 |
[jQuery] Best jQuery Plugins of the Week [1st September-7th September] (0) | 2013.09.10 |
[mssql] 숫자 앞에 0 으로 채우기, Replicate
-- 2013-9-2
select YEAR(getDate()), Month(getdate()), day(getdate())
-- 2013-09-02
select YEAR(getDate()), replicate('0',2 - len(Month(getdate()))) + cast(Month(getdate()) as varchar), replicate('0',2 - len(day(getdate()))) + cast(day(getdate()) as varchar)
[MSSQL] 저장프로시저 내용 보기 - SP, Stored Procedure (0) | 2013.09.23 |
---|---|
Robomongo - cross-platform MongoDB (0) | 2013.09.16 |
[MSSQL] 임시 Table 존재유무 확인 (0) | 2013.07.12 |
[MSSQL] mssql, getdate() 날짜 포멧 (0) | 2013.07.12 |
[MSSQL] ASP, MSSQL 에서 날짜 비교 (0) | 2013.07.09 |
40 Fresh jQuery Plugins To Make Your Website User Friendly
Flexisel – Responsive Carousel Plugin
Resize your browser window to see how you the plugin can adjust to the window width. Flexisel will adapt responsively as the screen width gets smaller…
Swipebox – A Touchable jQuery Lightbox
Swipebox is a jQuery “lightbox” plugin for desktop, mobile and tablet.
Sidr – Creating Facebook-Like Side Menus
The best jQuery plugin for creating side menus and the easiest way for doing your menu responsive.
Unslider – A ‘Super-Tiny’ jQuery Slider
The jQuery slider that just slides. No fancy effects or unnecessary markup, and it’s less than 3kb.
jQuery Nested – Create Multi-Column, Dynamic Grid Layouts
Nested is a jQuery plugin which allows you to create multi-column, dynamic grid layouts.
jResponsive – Super-Smooth Transition Layouts
JResponsive will organize your content in an efficient, dynamic and responsive layout. It can be applied to a container element and it will arrange its children in a layout that makes optimal use of screen space, by “packing” them in tightly. One of the very famous website that using this type of layout is Pulse.
MultiDialog utilizes jQuery UI Dialog Widget for a full featured Modalbox / Lightbox application.
FlexNav – Flexible, Device Agnostic Navigation
A jQuery Plugin for Responsive Menus.
Flaunt.js – Responsive Navs with Nested Click-To-Reveal
Flaunt.js is a jQuery script that allows you to create a responsive, nested navigation out the box. Flaunt was built to overcome responsive design challenges which faced a huge percentage of websites. This challenge was to show nested navigation items on click-demand, without the event taking you through to the page you’ve pressed…
SlideToucher – Touch Enabled jQuery Plugin for Content Swiping
SlideToucher, touch enabled jQuery plugin for content swiping. Supports vertical and horizontal swipes.
LiquidSlider – A Responsive jQuery Content Slider
A Responsive jQuery Content Slider.
Dropdown.dot.js – Flexible Dropdowns Based on dot.js Templates
A JQuery Plugin for super-flexible Dropdowns based on dot.js Templates.
Typeahead.js – A Fully-Featured Autocomplete Library
A fast and fully-featured autocomplete library.
iCheck – Customize Checkboxes & Radio Buttons
iCheck plugin works with checkboxes and radio buttons like a constructor.
Chardin.js – Simple Overlay Instructions for Apps
Simple overlay instructions for your apps.
This plugin can change selected colours to transparent on your image and give result as image or imagedata. This plugin works on IE9+, Chrome, Firefox, Safari. I didn’t try in opera.
A Lightweight Plugin for Creating a Customisable “Scroll-to-Top”.
Adding Alarms to the Digital Clock
Adding Alarms to the Digital Clock.
Ractive.js is different. It solves some of the biggest headaches in web development – data binding, efficient DOM updates, event handling – and does so with almost no learning curve.
Firechat is an open-source, real-time chat widget built on Firebase. It offers fully secure multi-user, multi-room chat with flexible authentication, moderator features, user presence and search, private messaging, chat invitations, and more.
Albumize is a jQuery plugin that lets you manage collection of images in the web page as albums. With albumize, you can browse albums, add cover image to albums and switch between albums.
PowerTip – A jQuery Hover Tooltip Plugin
PowerTip features a very flexible design that is easy to customize, gives you a number of different ways to use the tooltips, has APIs for developers, and supports adding complex data to tooltips. It is being actively developed and maintained, and provides a very fluid user experience.
jQuery Pin – Pin Any Element Within a Container
Query.Pin is here to help! Pin any element to the top of a container. Easily disable it for smaller screen-sizes where there’s no room for that kind of shenanigans.
Perfect-Scrollbar – A jQuery Scrollbar Plugin
Tiny but perfect jQuery scrollbar plugin.
Complexify aims to provide a good measure of password complexity for websites to use both for giving hints to users in the form of strength bars, and for casually enforcing a minimum complexity for security reasons.
The mobile-friendly, responsive, and lightweight jQuery date & time input picker.
It is a collection of HTML/CSS and JavaScript files to be used for web designers and developers.
A jQuery Plugin allows you to easely manipulate the Google Map API. You are now able to create maps, add some markers et create routes.
qTip2 – Pretty powerful tooltips
The second generation of the advanced qTip plugin for the ever popular jQuery framework.
Fast, light, mobile-friendly and responsive lightbox and modal dialog plugin. Open inline HTML, ajax loaded content, image, form, iframe (YouTube video, Vimeo, Google Maps), photo gallery. In/out animation effects are added with CSS3 transitions.
AutoHideInput is a simple jQuery plugin that hides and shows the information entered by the user.
A jQuery plugin that gives users real time hints & progress updates as they complete forms.
Thumbnail Grid with Expanding Preview
A tutorial on how to create a thumbnail grid with an expanding image preview similar to the effect seen on Google Images.
App Showcase with Grid Overlay
A tutorial about creating a simple grid overlay with subtle transitions for an app showcase.
A light weight jQuery plugin that is a must have for any developer to easily create modal windows. Put focus on important elements by applying a mask to your page and opening a customizable pop up modal window.
A light weight jQuery plugin that is a must have for any developer to easily create modal windows. Put focus on important elements by applying a mask to your page and opening a customizable pop up modal window.
Smint : Sticky Menu with Smooth Scroll
SMINT is a simple plugin for lovers of one page websites.
Random & Responsive jQuery, Html5 & Css3 Gallery with Lazyload.
Make Pretty Charts For Your App with jQuery and xCharts.
[jquery] 영문만, 숫자만, 한글만 입력. (0) | 2013.09.12 |
---|---|
[jQuery] jQuery.textcomplete: Autocomplete for textarea, 자동완성 (0) | 2013.09.12 |
[javascript] IE에서 문장 복사하기 (0) | 2013.09.11 |
[jQuery] Best jQuery Plugins of the Week [1st September-7th September] (0) | 2013.09.10 |
[jQuery] 50+ Best jQuery Plugins of August 2013 (0) | 2013.09.10 |
우리 뇌는 목표지향적이다.
뇌의 사령부격인 전두연합령에서 어떤 목표를 설정하면
신체의 나머지 부분은 거의 맹목적으로 이 목표를 추구하기 위한 노력을 한다.
도전이 크면 응전도 빨라진다. 몰입도가 올라간다.
결과적으로 머리가 좋아진다.
- 황농문 교수, ‘공부하는 힘’에서
황교수는 주장합니다.
‘계속되는 도전이 우리를 끝없이 성장시킨다고,
도전이 없으면 뇌는 발전하기 어렵다고,,,’
설정한 목표를 추구하기 위해서 우리 뇌는
그 목표에 가까워지면 쾌감이나 즐거움을 준다고 합니다.
나눠야 더욱 넘치게 행복해진다. (0) | 2013.09.16 |
---|---|
문제가 생기는 것은 나쁜 일이 아니다. (0) | 2013.09.13 |
스티브 잡스와 미켈란젤로의 공통점 (0) | 2013.09.11 |
창의적인 위대한 아이디어는 어떻게 만들어지나? (0) | 2013.09.10 |
위대한 사람이라 믿어주면 그들은 그것을 증명해준다. (0) | 2013.09.09 |
멋지게 살기 위해서 (0) | 2013.09.14 |
---|---|
좋은 부모 되기 정말 어렵다 (0) | 2013.09.13 |
맛있는 밥 (0) | 2013.09.11 |
의식 있는 진화 (0) | 2013.09.10 |
두려운 세상 (0) | 2013.09.09 |
가장 위대한 에너지源 가운데 하나는 자기가 하는 일에 대한 긍지. - 스포크 박사 -
사색없는 독서는 소화되지 않는 음식을 먹는 것과 같다. - 에드먼드 버크 - (0) | 2013.09.16 |
---|---|
그림자를 두려워 말라. 그림자란 빛이 어딘가 가까운 곳에서 비치고 있음을 뜻하는 것이다. - 루스 E.렌컬 - (0) | 2013.09.13 |
하나의 아이디어는 티끌이 될 수도 있고 마법으로 변할 수도 있다. 거기에 적용하는 재능에 따라. - 윌리엄 번배크 - (0) | 2013.09.11 |
자신이 지닌 재주는 무엇이든 십분 발휘하라. 가장 아름답게 노래 부르는 새들을 제외하고 다른 새들이 노래하지 않는 숲이 있다 치자. 그 얼마나 적막할 것인가. - 헨리 반 다이크 - (0) | 2013.09.10 |
가난한 사람은 독서로 부자가 되고, 부자는 독서로 귀하게 된다 - 왕안석 (0) | 2013.09.09 |
IE에서 문장 복사하기
[jQuery] jQuery.textcomplete: Autocomplete for textarea, 자동완성 (0) | 2013.09.12 |
---|---|
[jQuery] 40 Fresh jQuery Plugins To Make Your Website User Friendly (0) | 2013.09.12 |
[jQuery] Best jQuery Plugins of the Week [1st September-7th September] (0) | 2013.09.10 |
[jQuery] 50+ Best jQuery Plugins of August 2013 (0) | 2013.09.10 |
[javascript] David: Keep track of your Node dependecies (0) | 2013.09.09 |