-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
48 changed files
with
4,905 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.idea | ||
public | ||
node_modules | ||
temp |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"boss": true, | ||
"browser": true, | ||
"eqnull": true, | ||
"expr": true, | ||
"immed": true, | ||
"laxbreak": true, | ||
"loopfunc": true, | ||
"newcap": true, | ||
"noarg": true, | ||
"noempty": true, | ||
"nonew": true, | ||
"quotmark": true, | ||
"smarttabs": true, | ||
"strict": true, | ||
"sub": true, | ||
"trailing": true, | ||
"undef": true, | ||
"unused": true, | ||
"globals": { | ||
"angular": false | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/node_modules/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
language: node_js | ||
node_js: | ||
- '0.10' | ||
before_install: | ||
- export DISPLAY=:99.0 | ||
- sh -e /etc/init.d/xvfb start | ||
- npm install -g npm | ||
- npm install -g bower grunt-cli karma | ||
- npm install | ||
script: | ||
- grunt travis | ||
branches: | ||
only: | ||
- master |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,140 @@ | ||
# Build configurations. | ||
module.exports = (grunt) -> | ||
|
||
grunt.loadNpmTasks 'grunt-karma' | ||
grunt.loadNpmTasks 'grunt-contrib-connect' | ||
grunt.loadNpmTasks 'grunt-contrib-watch' | ||
grunt.loadNpmTasks 'grunt-contrib-coffee' | ||
grunt.loadNpmTasks 'grunt-contrib-jshint' | ||
grunt.loadNpmTasks 'grunt-contrib-concat' | ||
grunt.loadNpmTasks 'grunt-contrib-uglify' | ||
|
||
grunt.initConfig | ||
connect: | ||
app: | ||
options: | ||
base: './src/' | ||
middleware: require './server/middleware' | ||
port: 5001 | ||
watch: | ||
options: | ||
livereload: false | ||
karma: | ||
unit: | ||
options: | ||
autoWatch: true | ||
colors: true | ||
configFile: './test/karma.conf.js' | ||
keepalive: true | ||
port: 8081 | ||
runnerPort: 9100 | ||
travis: | ||
options: | ||
colors: true | ||
configFile: './test/karma.conf.js' | ||
runnerPort: 9100 | ||
singleRun: true | ||
|
||
# transpile CoffeeScript (.coffee) files to JavaScript (.js). | ||
coffee: | ||
build: | ||
files: [ | ||
cwd: './src' | ||
src: '*.coffee' | ||
dest: './temp/' | ||
expand: true | ||
ext: '.js' | ||
] | ||
options: | ||
bare: true | ||
#sourceMap: true | ||
|
||
#prepend 'use strict' to the files | ||
concat: | ||
#usestrict: | ||
options: | ||
banner: '(function () {\n\'use strict\';\n' | ||
footer: '}());' | ||
stripBanners: true | ||
process: (src, filepath) -> | ||
console.log("Processing #{filepath} ...") | ||
|
||
strings = /("(?:(?:\\")|[^"])*")/g | ||
singleQuotes = /'/g | ||
|
||
src.replace(strings, | ||
(match) -> | ||
console.log("match: " + match) | ||
result = "'" + match.substring(1, match.length-1).replace(singleQuotes, "\\'") + "'" | ||
console.log "replaced with: " + result | ||
result | ||
) | ||
|
||
dynamic_mappings: | ||
files: | ||
'dist/ui-scroll.js': ['./temp/**/ui-scroll.js'] | ||
'dist/ui-scroll-jqlite.js': ['./temp/**/ui-scroll-jqlite.js'] | ||
|
||
uglify: | ||
common: | ||
files: | ||
'./dist/ui-scroll.min.js': [ | ||
'./dist/ui-scroll.js' | ||
] | ||
'./dist/ui-scroll-jqlite.min.js': [ | ||
'./dist/ui-scroll-jqlite.js' | ||
] | ||
|
||
# run the linter | ||
jshint: | ||
dist: | ||
files: | ||
src: ['./dist/ui-scroll.js', './dist/ui-scroll-jqlite.js'] | ||
options: jshintrc: '.jshintrc' | ||
test: | ||
files: | ||
src : [ './test/*Spec.js'] | ||
options: grunt.util._.extend({}, grunt.file.readJSON('.jshintrc'), { | ||
node: true | ||
globals: | ||
angular: false | ||
inject: false | ||
jQuery: false | ||
jasmine: false | ||
afterEach: false | ||
beforeEach: false | ||
ddescribe: false | ||
describe: false | ||
expect: false | ||
iit: false | ||
it: false | ||
spyOn: false | ||
xdescribe: false | ||
xit: false | ||
}) | ||
|
||
# Starts a web server | ||
# Enter the following command at the command line to execute this task: | ||
# grunt server | ||
grunt.registerTask 'server', [ | ||
'connect' | ||
'watch' | ||
] | ||
|
||
grunt.registerTask 'default', ['server'] | ||
|
||
grunt.registerTask 'test', [ | ||
'karma:unit' | ||
] | ||
|
||
grunt.registerTask 'build', [ | ||
'jshint:test' | ||
'karma:travis' | ||
'coffee:build' | ||
'concat' | ||
'jshint:dist' | ||
'uglify:common'] | ||
|
||
grunt.registerTask 'travis', [ | ||
'karma:travis' | ||
] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
Copyright (c) 2013 Hill30 INC | ||
|
||
Permission is hereby granted, free of charge, to any person | ||
obtaining a copy of this software and associated documentation | ||
files (the "Software"), to deal in the Software without | ||
restriction, including without limitation the rights to use, | ||
copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the | ||
Software is furnished to do so, subject to the following | ||
conditions: | ||
|
||
The above copyright notice and this permission notice shall be | ||
included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES | ||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT | ||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | ||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
OTHER DEALINGS IN THE SOFTWARE. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"name": "ui-scroll", | ||
"version": "1.2.1", | ||
"homepage": "https://github.com/Hill30/NGScroller.git", | ||
"description": "AngularJS infinite scrolling module", | ||
"main": "./dist/ui-scroll.js", | ||
"keywords": [ | ||
"ui.scroll", | ||
"angularjs", | ||
"ui-utils", | ||
"ui.utils", | ||
"infinite", | ||
"live", | ||
"perpetual", | ||
"scroll", | ||
"scroller", | ||
"scrolling" | ||
], | ||
"license": "MIT", | ||
"ignore": [ | ||
"server", | ||
"test", | ||
"src/examples", | ||
"src/index.html", | ||
"**/.*", | ||
"Gruntfile.coffee", | ||
"package.json", | ||
"test.dat" | ||
] | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
angular.module('application', ['ui.scroll', 'ui.scroll.jqlite']).controller('mainController', | ||
[ '$scope', '$log', '$timeout' | ||
($scope, console, $timeout)-> | ||
|
||
# datasource implementation | ||
|
||
datasource = {} | ||
|
||
datasource.get = (index, count, success)-> | ||
$timeout( | ||
-> | ||
result = [] | ||
for i in [index..index + count-1] | ||
item = {} | ||
item.id = i | ||
item.content = "item #" + i | ||
result.push item | ||
success(result) | ||
100 | ||
) | ||
|
||
$scope.datasource = datasource | ||
|
||
|
||
# 1st list adapter implementation | ||
|
||
$scope.firstListAdapter = remain: true | ||
|
||
$scope.updateList1 = -> | ||
$scope.firstListAdapter.applyUpdates (item, scope) -> | ||
item.content += ' *' | ||
|
||
$scope.removeFromList1 = -> | ||
$scope.firstListAdapter.applyUpdates (item, scope) -> | ||
if scope.$index % 2 == 0 | ||
return [] | ||
|
||
idList1 = 1000 | ||
|
||
$scope.addToList1 = -> | ||
$scope.firstListAdapter.applyUpdates (item, scope) -> | ||
newItem = undefined | ||
if scope.$index == 2 | ||
newItem = | ||
id: idList1 | ||
content: 'a new one #' + idList1 | ||
idList1++ | ||
return [ | ||
item | ||
newItem | ||
] | ||
return | ||
|
||
|
||
# 2nd list adapter implementation | ||
|
||
$scope.updateList2 = -> | ||
$scope.second.list.adapter.applyUpdates (item, scope) -> | ||
item.content += ' *' | ||
|
||
$scope.removeFromList2 = -> | ||
$scope.second.list.adapter.applyUpdates (item, scope) -> | ||
if scope.$index % 2 != 0 | ||
return [] | ||
|
||
idList2 = 2000 | ||
|
||
$scope.addToList2 = -> | ||
$scope.second.list.adapter.applyUpdates (item, scope) -> | ||
newItem = undefined | ||
if scope.$index == 4 | ||
newItem = | ||
id: idList2 | ||
content: 'a new one #' + idList1 | ||
idList2++ | ||
return [ | ||
item | ||
newItem | ||
] | ||
return | ||
|
||
]) | ||
|
||
angular.bootstrap(document, ["application"]) | ||
|
||
### | ||
//# sourceURL=src/adapter.js | ||
### |
Oops, something went wrong.