<commit_before>/**
 * main.js
 * 애플리케이션 메인
 */
define( [ 'jquery', 'backbone', 'multipage-router', 'model/documents', 'view/home', 'view/index', 'view/tags', 'view/detail', 'view/detail-lnb', 'bootstrap', 'style!main' ], function ( $, Backbone, MultipageRouter, Documents, HomeView, IndexView, TagsView, DetailView, DetailLnbView ) {
	return {
		launch: function () {

			var docs = new Documents();

			// 모든 데이터를 다 받아오고 나면
			docs.on( 'sync', function () {

				// order 속성 순으로 정렬
				docs.comparator = function ( doc ) {
					return doc.get( 'order' );
				};
				docs.sort();

				// 부가 정보 만들기
				docs.each( function ( doc ) {
					var order = doc.get( 'order' );
					if ( order.length == 2 ) doc.set( 'secondDepth', true );
					else if ( order.length == 3 ) doc.set( 'thirdDepth', true );
					else if ( order.length == 4 ) doc.set( 'fourthDepth', true );
				} );

				// Router
				var MainRouter = MultipageRouter.extend( {

					pages: {
						'home': {
							fragment: [ '', 'home' ],
							el: '#page-home',
							render: function () {
								new HomeView( { collection: docs } ).render();
							},
							active: function () {
								$( '#nav-index' ).removeClass( 'active' );
								$( '#nav-tags' ).removeClass( 'active' );
							}
						},
						'index': {
							fragment: 'index',
							el: '#page-index',
							render: function () {
								new IndexView( { collection: docs } ).render();
							},
							active: function () {
								$( '#nav-index' ).addClass( 'active' );
								$( '#nav-tags' ).removeClass( 'active' );
							}
						},
						'tags': {
							fragment: 'tags',
							el: '#page-tags',
							render: function () {
								new TagsView( { collection: docs } ).render();
							},
							active: function () {
								$( '#nav-index' ).removeClass( 'active' );
								$( '#nav-tags' ).addClass( 'active' );
							}
						},
						'default': {
							render: function ( path ) {

								var doc = docs.get( path );

								if ( !doc ) {
									alert( 'Page not found' );
									history.back();
									return;
								}

								new DetailView( { collection: docs, model: doc } ).render();

								// 상세페이지 메뉴 랜더링
								this.DetailLnbView = this.DetailLnbView || new DetailLnbView( {collection: docs, model: doc} );
								this.DetailLnbView.model = doc;
								this.DetailLnbView.update();
							},
							active: function () {
								$( '#nav-index' ).removeClass( 'active' );
								$( '#nav-tags' ).removeClass( 'active' );
								$( '#page-detail' ).show();
								$('html, body').animate({ scrollTop : 0 }, "easeOutQuart"); 
							},
							inactive: function () {
								$( '#page-detail' ).hide();
							}
						}
					},

					transitions: {
						'home:index': 'fade',
						'home:tags': 'fade',
						'index:tags': 'fade'
					}
				} );

				new MainRouter();
				Backbone.history.start();
			} );

			docs.fetch();
		}
	};
} );<commit_msg>livedoc 상세페이지 이동 시 페이지 상단으로 스크롤하는 기능 조정. 애니메이션 스크롤 효과 없앰.<commit_after>/**
 * main.js
 * 애플리케이션 메인
 */
define( [ 'jquery', 'backbone', 'multipage-router', 'model/documents', 'view/home', 'view/index', 'view/tags', 'view/detail', 'view/detail-lnb', 'bootstrap', 'style!main' ], function ( $, Backbone, MultipageRouter, Documents, HomeView, IndexView, TagsView, DetailView, DetailLnbView ) {
	return {
		launch: function () {

			var docs = new Documents();

			// 모든 데이터를 다 받아오고 나면
			docs.on( 'sync', function () {

				// order 속성 순으로 정렬
				docs.comparator = function ( doc ) {
					return doc.get( 'order' );
				};
				docs.sort();

				// 부가 정보 만들기
				docs.each( function ( doc ) {
					var order = doc.get( 'order' );
					if ( order.length == 2 ) doc.set( 'secondDepth', true );
					else if ( order.length == 3 ) doc.set( 'thirdDepth', true );
					else if ( order.length == 4 ) doc.set( 'fourthDepth', true );
				} );

				// Router
				var MainRouter = MultipageRouter.extend( {

					pages: {
						'home': {
							fragment: [ '', 'home' ],
							el: '#page-home',
							render: function () {
								new HomeView( { collection: docs } ).render();
							},
							active: function () {
								$( '#nav-index' ).removeClass( 'active' );
								$( '#nav-tags' ).removeClass( 'active' );
							}
						},
						'index': {
							fragment: 'index',
							el: '#page-index',
							render: function () {
								new IndexView( { collection: docs } ).render();
							},
							active: function () {
								$( '#nav-index' ).addClass( 'active' );
								$( '#nav-tags' ).removeClass( 'active' );
							}
						},
						'tags': {
							fragment: 'tags',
							el: '#page-tags',
							render: function () {
								new TagsView( { collection: docs } ).render();
							},
							active: function () {
								$( '#nav-index' ).removeClass( 'active' );
								$( '#nav-tags' ).addClass( 'active' );
							}
						},
						'default': {
							render: function ( path ) {

								var doc = docs.get( path );

								if ( !doc ) {
									alert( 'Page not found' );
									history.back();
									return;
								}

								new DetailView( { collection: docs, model: doc } ).render();

								// 상세페이지 메뉴 랜더링
								this.DetailLnbView = this.DetailLnbView || new DetailLnbView( {collection: docs, model: doc} );
								this.DetailLnbView.model = doc;
								this.DetailLnbView.update();
							},
							active: function () {
								$( '#nav-index' ).removeClass( 'active' );
								$( '#nav-tags' ).removeClass( 'active' );
								$( '#page-detail' ).show();
								//$('html, body').animate({ scrollTop : 0 }, "easeOutQuart");
								$('html, body').scrollTop(0);
							},
							inactive: function () {
								$( '#page-detail' ).hide();
							}
						}
					},

					transitions: {
						'home:index': 'fade',
						'home:tags': 'fade',
						'index:tags': 'fade'
					}
				} );

				new MainRouter();
				Backbone.history.start();
			} );

			docs.fetch();
		}
	};
} );
{'fraction_non_alphanumeric': 0.1869631126831733, 'fraction_numerical': 0.0015159171298635675, 'mean_word_length': 1.9586447433981067, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3808337', 'n_tokens_mistral': 2962, 'n_tokens_neox': 2091, 'n_words': 440}