-
-
Save heat/53344ea71b2ca8d55eed73a5bff9679f to your computer and use it in GitHub Desktop.
imageapp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//this .js is supposed be adapters/application.js but I couldn't create an adapter here | |
import JSONAPIAdapter from 'ember-data/adapters/json-api'; | |
import Ember from 'ember'; | |
export default JSONAPIAdapter.extend({ | |
findAll: function(){ | |
return Ember.$.getJSON('http://api.donanimhaber.com/api/v1/site/NewsSite?pageIndex=0&pageSize=15'); | |
} | |
}); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
scrollingTimeout: 100, | |
bindScrolling: function() { | |
var self = this, | |
onScroll = function() { | |
Ember.run.debounce(self, self.runScrolled, self.scrollingTimeout); | |
}; | |
Ember.$(document).on('touchmove.scrollable', onScroll); | |
Ember.$(window).on('scroll.scrollable', onScroll); | |
}.on('didInsertElement'), | |
unbindScrolling: function() { | |
Ember.$(window).off('.scrollable'); | |
Ember.$(document).off('.scrollable'); | |
}.on('willDestroyElement'), | |
preservePos: function() { | |
console.log(' Preserve Position '+this.get('currentPos')); | |
Ember.$(window).scrollTop(this.getWithDefault('currentPos', 0)); | |
}.on('didInsertElement'), | |
runScrolled: function() { | |
var position = Ember.$(document).height() - Ember.$(window).scrollTop(); | |
var viewportHeight = document.documentElement.clientHeight; | |
this.set('currentPos', Ember.$(window).scrollTop()); | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle' | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
currentPos:0 | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//import Model from 'ember-data/model'; | |
//import attr from 'ember-data/attr'; | |
import DS from 'ember-data'; | |
export default DS.Model.extend({ | |
Id : DS.attr('number'), | |
Title : DS.attr('string'), | |
Content : DS.attr('string'), | |
Image : DS.attr('string'), | |
//ImageBlog : DS.attr(), | |
//Image1080x600 : DS.attr(), | |
//Image285x300 : DS.attr(), | |
//Image340x191 :DS.attr(), | |
//Image340xmin340max600 : DS.attr(), | |
//Image475x300 : DS.attr(), | |
//Image710x500 : DS.attr(), | |
//Image760x300 : DS.attr(), | |
//CreateDate : DS.attr(), | |
//CategoryName : DS.attr(), | |
//EditorName : DS.attr(), | |
//Type : DS.attr(), | |
NewsUrl :DS.attr('string') | |
//CategoriUrl : DS.attr(), | |
//VerticalImage : DS.attr(), | |
//HasPopular : DS.attr(), | |
//IsAppNews : DS.attr(), | |
//Url : DS.attr(), | |
//PreferedTag : DS.attr(), | |
//EditorTagUrl : DS.attr(), | |
//DateCreated : DS.attr(), | |
//ReadCount : DS.attr(), | |
//TotalWatch : DS.attr(), | |
//IsFollow : DS.attr(), | |
//ImgIcon : DS.attr(), | |
//ImageHeight : DS.attr(), | |
//ImageHeight710 : attr() | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
import config from './config/environment'; | |
const Router = Ember.Router.extend({ | |
location: 'none' | |
}); | |
Router.map(function() { | |
this.route('index',{path:'/'}); | |
this.route('pic', {path:'/new/:NewsUrl'}); | |
this.route('news'); | |
}); | |
export default Router; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Route.extend({ | |
model() { | |
return Ember.$.getJSON('http://api.donanimhaber.com/api/v1/site/NewsSite?pageIndex=0&pageSize=15'); | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Route.extend({ | |
model: function(params) { | |
return { | |
"Id": 84909, | |
"Title": "Turkcell Superonline kullanıcılarını reklam izlemeye mi zorluyor?", | |
"Content": "Turkcell Superonline’ın bazı sitelerde kullanıcılarına izinsiz bir şekilde reklam videoları göstermeye başladığına yönelik bir dizi iddia söz konusu. İşte konuya ilişkin detaylar:", | |
"Image": "https://v2.donanimhaber.com/images/images/haber/84909/340x191Turkcell-Superonline-kullanicilarini-reklam-izlemeye-mi-zorluyor.jpg", | |
"ImageBlog": "https://v2.donanimhaber.com/images/images/haber/84909/710x500Turkcell-Superonline-kullanicilarini-reklam-izlemeye-mi-zorluyor.jpg", | |
"Image1080x600": "", | |
"Image285x300": "https://v2.donanimhaber.com/images/images/haber/84909/285xTurkcell-Superonline-kullanicilarini-reklam-izlemeye-mi-zorluyor.jpg", | |
"Image340x191": "https://v2.donanimhaber.com/images/images/haber/84909/340x191Turkcell-Superonline-kullanicilarini-reklam-izlemeye-mi-zorluyor.jpg", | |
"Image340xmin340max600": "", | |
"Image475x300": "https://v2.donanimhaber.com/images/images/haber/84909/475x300Turkcell-Superonline-kullanicilarini-reklam-izlemeye-mi-zorluyor.jpg", | |
"Image710x500": "https://v2.donanimhaber.com/images/images/haber/84909/710x500Turkcell-Superonline-kullanicilarini-reklam-izlemeye-mi-zorluyor.jpg", | |
"Image760x300": "", | |
"CreateDate": "43 dakika", | |
"CategoryName": "Operatörler - Kurumsal Haberler", | |
"EditorName": "Ahmet Gözütok", | |
"Type": 0, | |
"NewsUrl": "Turkcell-Superonline-kullanicilarini-reklam-izlemeye-mi-zorluyor", | |
"CategoriUrl": "operatorler--kurumsal-haberler", | |
"VerticalImage": false, | |
"HasPopular": 0, | |
"IsAppNews": false, | |
"Url": "/Turkcell-Superonline-kullanicilarini-reklam-izlemeye-mi-zorluyor-84909", | |
"PreferedTag": "turkcell superonline", | |
"EditorTagUrl": "ahmet-gozutok", | |
"DateCreated": "2016-06-10T19:30:00", | |
"ReadCount": 543, | |
"TotalWatch": 543, | |
"IsFollow": 0, | |
"ImgIcon": "https://v2.donanimhaber.com/images/images/iconshd/turkcell.gif", | |
"ImageHeight": 191, | |
"ImageHeight710": 399 | |
};}, | |
activate: function() { | |
this._super(...arguments); | |
window.scrollTo(0,0); | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.8.1", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
"ember": "2.5.1", | |
"ember-data": "2.5.2", | |
"ember-template-compiler": "2.5.1" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment