-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
18 changed files
with
377 additions
and
53 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 |
---|---|---|
|
@@ -3,3 +3,4 @@ | |
/dist | ||
/nbproject/private | ||
/node_modules | ||
/.vagrant |
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 |
---|---|---|
@@ -1,9 +1,12 @@ | ||
language: node_js | ||
node_js: | ||
- "0.10" | ||
- "4.5.0" | ||
before_install: | ||
- npm install -g grunt-cli | ||
- gem install sass --version "=3.4.21" | ||
- rvm install 2.4.1 | ||
- gem install sass --version "=3.4.23" | ||
- gem install compass --version "=1.0.3" | ||
install: npm install | ||
install: | ||
- npm update -g | ||
- npm install | ||
script: grunt build |
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 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 |
---|---|---|
@@ -1,15 +1,41 @@ | ||
# Questionable Content Extensions User Script [![Build Status](https://travis-ci.org/Questionable-Content-Extensions/client.svg?branch=master)](https://travis-ci.org/Questionable-Content-Extensions/client) [![Dependency Status](https://www.versioneye.com/user/projects/56e06979df573d004c95f841/badge.svg?style=flat)](https://www.versioneye.com/user/projects/56e06979df573d004c95f841) [![Built with Grunt](https://cdn.gruntjs.com/builtwith.svg)](http://gruntjs.com/) | ||
# Questionable Content Extensions User Script [![Build Status](https://travis-ci.org/Questionable-Content-Extensions/client.svg?branch=master)](https://travis-ci.org/Questionable-Content-Extensions/client) [![Dependency Status](https://www.versioneye.com/user/projects/58da3f4f26a5bb0038e42095/badge.svg?style=flat)](https://www.versioneye.com/user/projects/58da3f4f26a5bb0038e42095) [![Built with Grunt](https://cdn.gruntjs.com/builtwith.svg)](http://gruntjs.com/) | ||
|
||
## Getting Started | ||
|
||
This project requires [Node.js®](https://nodejs.org/en/). Install it on your system in whatever manner is appropriate for your operating system, and then open a terminal and run the following commands after cloning this repository: | ||
To build this project, you can make use of a [Vagrant virtual machine build environment](https://www.vagrantup.com/) which will take care of setting the build environment up for you (recommended) or, you can install the build environment on your own computer. | ||
|
||
### Building using Vagrant | ||
|
||
Install [Vagrant](https://www.vagrantup.com/) if you don't already have it on your system. (If you're not familiar with Vagrant from before, reading the [Getting Started](https://www.vagrantup.com/docs/getting-started/) documentation is recommended to get a feel for what it is about.) | ||
|
||
Once Vagrant is installed, clone this repository, then run the following commands in the repository directory: | ||
|
||
```shell | ||
npm install -g grunt-cli # If you don't have grunt installed already | ||
npm install # To get all the grunt plugins we use | ||
vagrant up # To initialize the Vagrant virtual machine (this will take a while the first time) | ||
vagrant ssh # To log into the virtual machine | ||
grunt build # To build our script | ||
``` | ||
|
||
After having ran the commands above, you should have files created at `dist\qc-ext.user.js` and `dist\qc-ext.min.user.js`. These files can be opened in Greasemonkey or Tampermonkey directly. | ||
After having run the commands above, you should have files created at `dist\qc-ext.user.js` and `dist\qc-ext.min.user.js` within the repository. These files can be opened in Greasemonkey or Tampermonkey directly. | ||
|
||
Whenever you've made changes and want to incorporate them into the user script, simply run `grunt build` in the Vagrant VM again. | ||
|
||
When you're done developing, simply log off the virtual machine (`exit`) and run `vagrant suspend` or `vagrant halt`. To resume work later, just repeat the sequence of commands shown above. Should you want to remove the virtual machine, run `vagrant destroy`. | ||
|
||
### Building on your own computer | ||
|
||
This project requires [Node.js®](https://nodejs.org/) and [Ruby](https://www.ruby-lang.org/). Install them on your system in whatever manner is appropriate for your operating system, clone this repository, then run the following commands in the repository directory: | ||
|
||
```shell | ||
gem install compass # If you don't have compass installed already | ||
npm install -g grunt-cli # If you don't have grunt installed already | ||
npm install -g jsonlint # If you don't have jsonlint installed already | ||
npm install -g jshint # If you don't have jshint installed already | ||
npm install # To install all the grunt plugins we use | ||
grunt build # To build our script | ||
``` | ||
|
||
After having run the commands above, you should have files created at `dist\qc-ext.user.js` and `dist\qc-ext.min.user.js` within the repository. These files can be opened in Greasemonkey or Tampermonkey directly. | ||
|
||
Whenever you've made changes and want to incorporate them into the user script, simply run `grunt build` again. | ||
|
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,68 @@ | ||
# -*- mode: ruby -*- | ||
# vi: set ft=ruby : | ||
|
||
# All Vagrant configuration is done below. The "2" in Vagrant.configure | ||
# configures the configuration version (we support older styles for | ||
# backwards compatibility). Please don't change it unless you know what | ||
# you're doing. | ||
Vagrant.configure("2") do |config| | ||
# The most common configuration options are documented and commented below. | ||
# For a complete reference, please see the online documentation at | ||
# https://docs.vagrantup.com. | ||
|
||
# Every Vagrant development environment requires a box. You can search for | ||
# boxes at https://atlas.hashicorp.com/search. | ||
config.vm.box = "hashicorp/precise64" | ||
|
||
# Disable automatic box update checking. If you disable this, then | ||
# boxes will only be checked for updates when the user runs | ||
# `vagrant box outdated`. This is not recommended. | ||
# config.vm.box_check_update = false | ||
|
||
# Create a forwarded port mapping which allows access to a specific port | ||
# within the machine from a port on the host machine. In the example below, | ||
# accessing "localhost:8080" will access port 80 on the guest machine. | ||
# config.vm.network "forwarded_port", guest: 80, host: 8080 | ||
|
||
# Create a private network, which allows host-only access to the machine | ||
# using a specific IP. | ||
# config.vm.network "private_network", ip: "192.168.33.10" | ||
|
||
# Create a public network, which generally matched to bridged network. | ||
# Bridged networks make the machine appear as another physical device on | ||
# your network. | ||
# config.vm.network "public_network" | ||
|
||
# Share an additional folder to the guest VM. The first argument is | ||
# the path on the host to the actual folder. The second argument is | ||
# the path on the guest to mount the folder. And the optional third | ||
# argument is a set of non-required options. | ||
# config.vm.synced_folder "../data", "/vagrant_data" | ||
|
||
# Provider-specific configuration so you can fine-tune various | ||
# backing providers for Vagrant. These expose provider-specific options. | ||
# Example for VirtualBox: | ||
# | ||
# config.vm.provider "virtualbox" do |vb| | ||
# # Display the VirtualBox GUI when booting the machine | ||
# vb.gui = true | ||
# | ||
# # Customize the amount of memory on the VM: | ||
# vb.memory = "1024" | ||
# end | ||
# | ||
# View the documentation for the provider you are using for more | ||
# information on available options. | ||
|
||
# Define a Vagrant Push strategy for pushing to Atlas. Other push strategies | ||
# such as FTP and Heroku are also available. See the documentation at | ||
# https://docs.vagrantup.com/v2/push/atlas.html for more information. | ||
# config.push.define "atlas" do |push| | ||
# push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME" | ||
# end | ||
|
||
# Enable provisioning with a shell script. Additional provisioners such as | ||
# Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the | ||
# documentation for more information about their specific syntax and use. | ||
config.vm.provision "shell", path: "provision.sh", privileged: false | ||
end |
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 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 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 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,66 @@ | ||
/* | ||
* Copyright (C) 2016, 2017 Alexander Krivács Schrøder <[email protected]> | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
/* global constants */ | ||
|
||
var qcExt; | ||
|
||
(function(qcExt) { | ||
'use strict'; | ||
|
||
qcExt.app.directive('qcComicNav', function() { | ||
return { | ||
restrict: 'E', | ||
replace: true, | ||
scope: {}, | ||
controller: ['$log', 'comicService', 'latestComic', 'eventFactory', | ||
'$scope', | ||
function($log, comicService, latestComic, Event, $scope) { | ||
$log.debug('START qcComicNav()'); | ||
|
||
var comicDataLoadedEvent = | ||
new Event(constants.comicdataLoadedEvent); | ||
|
||
this.currentComic = null; | ||
this.latestComic = latestComic; | ||
var self = this; | ||
|
||
this.go = function() { | ||
$log.debug('qcComicNav.go(): ' + self.currentComic); | ||
if (self.currentComic === undefined || | ||
self.currentComic === null) { | ||
self.currentComic = latestComic; | ||
} else if (self.currentComic < 1) { | ||
self.currentComic = 1; | ||
} else if (self.currentComic > latestComic) { | ||
self.currentComic = latestComic; | ||
} | ||
comicService.gotoComic(self.currentComic); | ||
}; | ||
|
||
comicDataLoadedEvent.subscribe($scope, | ||
function(event, comicData) { | ||
self.currentComic = comicData.comic; | ||
}); | ||
|
||
$log.debug('END qcComicNav()'); | ||
}], | ||
controllerAs: 'cn', | ||
template: qcExt.variables.angularTemplates.comicNav | ||
}; | ||
}); | ||
})(qcExt || (qcExt = {})); |
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
Oops, something went wrong.