forked from mohamedrias/MultiCopier
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added multicopier chrome extension project
- Loading branch information
0 parents
commit 26f3e33
Showing
27 changed files
with
26,802 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 @@ | ||
.idea |
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,11 @@ | ||
/** | ||
* User: Rias | ||
* Date: 2/20/15 | ||
* Time: 8:06 PM | ||
* Description : Description will be here | ||
* File name : app.js | ||
*/ | ||
|
||
"use strict"; | ||
|
||
angular.module("multicopier", []) |
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,11 @@ | ||
/** | ||
* User: Rias | ||
* Date: 2/20/15 | ||
* Time: 10:28 PM | ||
* Description : Description will be here | ||
* File name : background.controller.js | ||
*/ | ||
angular.module("multicopier.background") | ||
.controller("BackgroundController", ["MultiCopierBackgroundService", function(MultiCopierBackgroundService) { | ||
|
||
}]); |
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,18 @@ | ||
<html data-ng-app="multicopier.background" data-ng-csp> | ||
<head> | ||
<script type="text/javascript" src="../common/lib/angular.js"></script> | ||
<script type="text/javascript" src="../common/lib/jquery-2.0.3.min.js"></script> | ||
<script type="text/javascript" src="../common/lib/moment.min.js"></script> | ||
<link href="../common/css/bootstrap.min.css" rel="stylesheet" type="text/css"> | ||
<link href="../common/css/font-awesome.min.css" rel="stylesheet" type="text/css"> | ||
<link href="../common/css/style.css" rel="stylesheet" type="text/css"> | ||
</head> | ||
<body data-ng-controller="BackgroundController"> | ||
<section id="secret-sauce"> | ||
<input type="text" id="copier" value="" name="copier"> | ||
</section> | ||
<script type="text/javascript" src="../app.js"></script> | ||
<script type="text/javascript" src="background.service.js"></script> | ||
<script type="text/javascript" src="background.controller.js"></script> | ||
</body> | ||
</html> |
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,63 @@ | ||
/** | ||
* User: Rias | ||
* Date: 2/20/15 | ||
* Time: 8:01 PM | ||
* Description : Description will be here | ||
* File name : multicopier.service.js | ||
*/ | ||
|
||
angular.module("multicopier.background",[]) | ||
.factory("MultiCopierBackgroundService", function () { | ||
|
||
var multicopierService = {}; | ||
|
||
multicopierService.$selector = $("#secret-sauce #copier"); | ||
|
||
multicopierService.readLocalStorage = function () { | ||
return ((localStorage.multicopier) ? JSON.parse(localStorage.multicopier) : []); | ||
} | ||
|
||
|
||
multicopierService.updateLocalStorage = function() { | ||
localStorage.setItem("multicopier", JSON.stringify(multicopierService.dataStore)); | ||
} | ||
|
||
|
||
multicopierService.dataStore = multicopierService.readLocalStorage(); | ||
|
||
multicopierService.onCopy = function () { | ||
multicopierService.$selector.val('').focus(); | ||
document.execCommand('paste'); | ||
var data = multicopierService.$selector.val(); | ||
if(!data) return; | ||
var isUnique = multicopierService.checkDuplicate(data); | ||
if(!isUnique) return; | ||
console.log(multicopierService.dataStore); | ||
insertData(multicopierService.$selector.val()); | ||
} | ||
|
||
var insertData = function(data) { | ||
var tempData = {}; | ||
tempData.date = Date.now(); | ||
tempData.val = data; | ||
multicopierService.dataStore.push(tempData); | ||
multicopierService.updateLocalStorage(); | ||
} | ||
|
||
multicopierService.checkDuplicate = function(value) { | ||
var isUnique = true; | ||
for(var i = 0, len = multicopierService.dataStore.length; i < len ; i++) { | ||
if(multicopierService.dataStore[i].val == value) { | ||
isUnique = false; | ||
break; | ||
} | ||
}; | ||
return isUnique; | ||
} | ||
|
||
setInterval(function() { | ||
multicopierService.onCopy(); | ||
},300); | ||
|
||
return multicopierService; | ||
}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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,3 @@ | ||
body { | ||
transition: height 0.4s ease-out; | ||
} |
Binary file not shown.
Binary file not shown.
Oops, something went wrong.