• Description
- 본패키지는 AshAPI 라이브러리와 구동에 필요한 google.search의 js 파일 src 와 openAPI key값이 추가적으로 필요하다.
- GoogleSearch 전용 패키지로써 인스턴스 자체가 패키지로 구성되어 있으며 추가적으로 google.search.의 하위
패키지에 대응하는 video,image,global,... 등의 클래스가 다시 개별적으로 존재한다.
(※ 현재는 image 만 구현되어있다.)
- 구동을 위한 GoogleSearch AJAX API가 embeded 된 별도의 GS.html이 필요하다.(GoogleSearch API JS파일), Google API key값 생성필요.
- GoogleSearch AJAX API 자체가 용량이 크기때문에 사용할 메인페이지에 직접 붙여서 사용할경우 원 메인페이지의 전체 로드에
영향을 미치게 됨으로 그와 같은 문제를 사전에 해결하기위해 본 클래스는 GS 실행을 위해 페이지로드를 Iframe으로 처리하고
구동메소드를 실행해서 구현하는 방식을 취하고 있다.
즉 페이지가 로드 된후 AshGoogleSearch.start() 메소드를 실행하여 처리하면 GoogleSearch를 사용하면서 발생하는
페이지 부하 문제를 해결할 수 있게된다.
따라서 인스턴스 생성 처리는 AshGoogleSearch.START 이벤트가 수행완료되는 시점에 생성해서 처리해야 만 동작상의 문제를 사전에 막을 수 있다.
AshGoogleSearch.addEventListener(AshGoogleSearch.START, listener) 후에 적용.
• ClassType
Instanced Static
• Inherited Public Properties
instancedCount (Defined by Ash)
owner (Defined by AshEventDispatcher)
openData (Defined by AshEventDispatcher)
• Inherited Public Methods
getClass (Defined by Ash)
toString (Defined by Ash)
addEventListener (Defined by AshEventDispatcher)
removeEventListener (Defined by AshEventDispatcher)
dispatchEvent (Defined by AshEventDispatcher)
hasEventListener (Defined by AshEventDispatcher)
getEventListeners (Defined by AshEventDispatcher)
• Costants
AshGoogleSearch.SHOW = 'show'; // fire when application is shown.
어플리케이션이 보여질때 이벤트가 발생한다.
AshGoogleSearch.HIDE= 'hide' // fire when application is hidden.
어플리케이션이 사라질때 이벤트가 발생한다.
AshGoogleSearch.START = 'start'; // invoke after the google search file load completed.
GS파일이 로드완료되고 사용상태가 준비됬을때 이벤트가 발생한다.
AshGoogleSearch.SEARCH = 'search'; // invoke when search is completed.
모든 search 명령이 수행되고 search가 완료 되었을때 이벤트가 발생한다.
AshGoogleSearch.IMAGE_LOADED = 'imageLoaded'; // invoke when the thumbnail image is loaded.
구글 image search의 경우 이미지로드가 완료되었을때 이벤트가 발생한다.
AshGoogleSearch.SELECTED = 'selected' // invoke when the item is selelected.
현재 구글서치내의 아이템(비디오,이미지,텍스트...)을 선택할때 이벤트가 발생한다.
• Static Properties
AshGoogleSearch.google = null;
GloogleSearch 의 google 클래스(패키지)가 정의된 속성값.
AshGoogleSearch.start 메소드가 수행된 후 AshGoogleSearch.START 이벤트가 발생되기 전에
값이 바인딩된다.
• Static Methods
AshGoogleSearch.start() // Start the AshGoogleSearch.
반드시 AshGoogleSearch를 사용하기 이전에 이 메소드를 실행해야 하며 메인페이지가 로드된 후에 사용해야 한다.
usage |
var sgsi;
var wEvent = new AshEventDispatcher(window);
AshGoogleSearch.addEventListener(AshGoogleSearch.START, function(e) {
sgsi = new AshGoogleSearch.Image();
sgsi.search('오바마'); // 오바마 이미지를 서칭.
});
// 페이지의 모든 요소들이 먼저로드 된 후 GoogleSearch를 구동한다.
wEvent.addEventListener('load', function(e) {
AshGoogleSearch.start('GS.html');
});
• On Event Handler
-
• Public Properties
-
• Public Methods
-
• Constructor
-