mirror of
https://github.com/c0de-archive/Fox.ci_Chrome_Extension.git
synced 2024-12-22 13:42:39 +00:00
Initial commit
This commit is contained in:
commit
835b7b3f0d
1
.idea/.name
generated
Normal file
1
.idea/.name
generated
Normal file
@ -0,0 +1 @@
|
|||||||
|
Fox.ci Chrome Extension
|
8
.idea/Fox.ci Chrome Extension.iml
generated
Normal file
8
.idea/Fox.ci Chrome Extension.iml
generated
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module type="WEB_MODULE" version="4">
|
||||||
|
<component name="NewModuleRootManager">
|
||||||
|
<content url="file://$MODULE_DIR$" />
|
||||||
|
<orderEntry type="inheritedJdk" />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
</component>
|
||||||
|
</module>
|
4
.idea/encodings.xml
generated
Normal file
4
.idea/encodings.xml
generated
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
|
||||||
|
</project>
|
4
.idea/misc.xml
generated
Normal file
4
.idea/misc.xml
generated
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectRootManager" version="2" />
|
||||||
|
</project>
|
8
.idea/modules.xml
generated
Normal file
8
.idea/modules.xml
generated
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectModuleManager">
|
||||||
|
<modules>
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/.idea/Fox.ci Chrome Extension.iml" filepath="$PROJECT_DIR$/.idea/Fox.ci Chrome Extension.iml" />
|
||||||
|
</modules>
|
||||||
|
</component>
|
||||||
|
</project>
|
5
.idea/scopes/scope_settings.xml
generated
Normal file
5
.idea/scopes/scope_settings.xml
generated
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<component name="DependencyValidationManager">
|
||||||
|
<state>
|
||||||
|
<option name="SKIP_IMPORT_STATEMENTS" value="false" />
|
||||||
|
</state>
|
||||||
|
</component>
|
6
.idea/vcs.xml
generated
Normal file
6
.idea/vcs.xml
generated
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="" vcs="" />
|
||||||
|
</component>
|
||||||
|
</project>
|
66
_locales/en/messages.json
Executable file
66
_locales/en/messages.json
Executable file
@ -0,0 +1,66 @@
|
|||||||
|
{
|
||||||
|
"l10nTabName": {
|
||||||
|
"message":"Localization"
|
||||||
|
,"description":"name of the localization tab"
|
||||||
|
}
|
||||||
|
,"l10nHeader": {
|
||||||
|
"message":"It does localization too! (this whole tab is, actually)"
|
||||||
|
,"description":"Header text for the localization section"
|
||||||
|
}
|
||||||
|
,"l10nIntro": {
|
||||||
|
"message":"'L10n' refers to 'Localization' - 'L' an 'n' are obvious, and 10 comes from the number of letters between those two. It is the process/whatever of displaying something in the language of choice. It uses 'I18n', 'Internationalization', which refers to the tools / framework supporting L10n. I.e., something is internationalized if it has I18n support, and can be localized. Something is localized for you if it is in your language / dialect."
|
||||||
|
,"description":"introduce the basic idea."
|
||||||
|
}
|
||||||
|
,"l10nProd": {
|
||||||
|
"message":"You <strong>are</strong> planning to allow localization, right? You have <em>no idea</em> who will be using your extension! You have no idea who will be translating it! At least support the basics, it's not hard, and having the framework in place will let you transition much more easily later on."
|
||||||
|
,"description":"drive the point home. It's good for you."
|
||||||
|
}
|
||||||
|
,"l10nFirstParagraph": {
|
||||||
|
"message":"When the options page loads, elements decorated with <strong>data-l10n</strong> will automatically be localized!"
|
||||||
|
,"description":"inform that <el data-l10n='' /> elements will be localized on load"
|
||||||
|
}
|
||||||
|
,"l10nSecondParagraph": {
|
||||||
|
"message":"If you need more complex localization, you can also define <strong>data-l10n-args</strong>. This should contain <span class='code'>$containerType$</span> filled with <span class='code'>$dataType$</span>, which will be passed into Chrome's i18n API as <span class='code'>$functionArgs$</span>. In fact, this paragraph does just that, and wraps the args in mono-space font. Easy!"
|
||||||
|
,"description":"introduce the data-l10n-args attribute. End on a lame note."
|
||||||
|
,"placeholders": {
|
||||||
|
"containerType": {
|
||||||
|
"content":"$1"
|
||||||
|
,"example":"'array', 'list', or something similar"
|
||||||
|
,"description":"type of the args container"
|
||||||
|
}
|
||||||
|
,"dataType": {
|
||||||
|
"content":"$2"
|
||||||
|
,"example":"string"
|
||||||
|
,"description":"type of data in each array index"
|
||||||
|
}
|
||||||
|
,"functionArgs": {
|
||||||
|
"content":"$3"
|
||||||
|
,"example":"arguments"
|
||||||
|
,"description":"whatever you call what you pass into a function/method. args, params, etc."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
,"l10nThirdParagraph": {
|
||||||
|
"message":"Message contents are passed right into innerHTML without processing - include any tags (or even scripts) that you feel like. If you have an input field, the placeholder will be set instead, and buttons will have the value attribute set."
|
||||||
|
,"description":"inform that we handle placeholders, buttons, and direct HTML input"
|
||||||
|
}
|
||||||
|
,"l10nButtonsBefore": {
|
||||||
|
"message":"Different types of buttons are handled as well. <button> elements have their html set:"
|
||||||
|
}
|
||||||
|
,"l10nButton": {
|
||||||
|
"message":"in a <strong>button</strong>"
|
||||||
|
}
|
||||||
|
,"l10nButtonsBetween": {
|
||||||
|
"message":"while <input type='submit'> and <input type='button'> get their 'value' set (note: no HTML):"
|
||||||
|
}
|
||||||
|
,"l10nSubmit": {
|
||||||
|
"message":"a <strong>submit</strong> value"
|
||||||
|
}
|
||||||
|
,"l10nButtonsAfter": {
|
||||||
|
"message":"Awesome, no?"
|
||||||
|
}
|
||||||
|
,"l10nExtras": {
|
||||||
|
"message":"You can even set <span class='code'>data-l10n</span> on things like the <title> tag, which lets you have translatable page titles, or fieldset <legend> tags, or anywhere else - the default <span class='code'>Boil.localize()</span> behavior will check every tag in the document, not just the body."
|
||||||
|
,"description":"inform about places which may not be obvious, like <title>, etc"
|
||||||
|
}
|
||||||
|
}
|
BIN
icons/icon128.png
Executable file
BIN
icons/icon128.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 6.5 KiB |
BIN
icons/icon16.png
Executable file
BIN
icons/icon16.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 4.4 KiB |
BIN
icons/icon19.png
Executable file
BIN
icons/icon19.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 4.4 KiB |
BIN
icons/icon48.png
Executable file
BIN
icons/icon48.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 4.4 KiB |
3
js/jquery/.gitignore
vendored
Executable file
3
js/jquery/.gitignore
vendored
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
build
|
||||||
|
jquery-migrate.js
|
||||||
|
jquery-migrate.min.js
|
4
js/jquery/README.md
Executable file
4
js/jquery/README.md
Executable file
@ -0,0 +1,4 @@
|
|||||||
|
jQuery Component
|
||||||
|
================
|
||||||
|
|
||||||
|
Shim repository for jQuery.
|
13
js/jquery/bower.json
Executable file
13
js/jquery/bower.json
Executable file
@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"name": "jquery",
|
||||||
|
"version": "2.0.0",
|
||||||
|
"description": "jQuery component",
|
||||||
|
"keywords": [
|
||||||
|
"jquery",
|
||||||
|
"component"
|
||||||
|
],
|
||||||
|
"scripts": [
|
||||||
|
"jquery.js"
|
||||||
|
],
|
||||||
|
"license": "MIT"
|
||||||
|
}
|
21
js/jquery/component.json
Executable file
21
js/jquery/component.json
Executable file
@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"name": "jquery",
|
||||||
|
"version": "2.0.0",
|
||||||
|
"description": "jQuery component",
|
||||||
|
"keywords": [
|
||||||
|
"jquery",
|
||||||
|
"component"
|
||||||
|
],
|
||||||
|
"scripts": [
|
||||||
|
"jquery.js"
|
||||||
|
],
|
||||||
|
"license": "MIT",
|
||||||
|
"gitHead": "46f8412bd1bb9b1b30b5b0eb88560e2d4196509c",
|
||||||
|
"readme": "jQuery Component\n================\n\nShim repository for jQuery.\n",
|
||||||
|
"readmeFilename": "README.md",
|
||||||
|
"_id": "jquery@2.0.0",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git://github.com/components/jquery.git"
|
||||||
|
}
|
||||||
|
}
|
30
js/jquery/composer.json
Executable file
30
js/jquery/composer.json
Executable file
@ -0,0 +1,30 @@
|
|||||||
|
{
|
||||||
|
"name": "components/jquery",
|
||||||
|
"description": "jQuery JavaScript Library",
|
||||||
|
"type": "component",
|
||||||
|
"homepage": "http://jquery.com",
|
||||||
|
"license": "MIT",
|
||||||
|
"support": {
|
||||||
|
"irc": "irc://irc.freenode.org/jquery",
|
||||||
|
"issues": "http://bugs.jquery.com",
|
||||||
|
"forum": "http://forum.jquery.com",
|
||||||
|
"wiki": "http://docs.jquery.com/",
|
||||||
|
"source": "https://github.com/jquery/jquery"
|
||||||
|
},
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "John Resig",
|
||||||
|
"email": "jeresig@gmail.com"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"require": {
|
||||||
|
"robloach/component-installer": "*"
|
||||||
|
},
|
||||||
|
"extra": {
|
||||||
|
"component": {
|
||||||
|
"scripts": [
|
||||||
|
"jquery.js"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
8755
js/jquery/jquery.js
vendored
Executable file
8755
js/jquery/jquery.js
vendored
Executable file
File diff suppressed because it is too large
Load Diff
6
js/jquery/jquery.min.js
vendored
Executable file
6
js/jquery/jquery.min.js
vendored
Executable file
File diff suppressed because one or more lines are too long
7
js/jquery/package.json
Executable file
7
js/jquery/package.json
Executable file
@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"name": "components-jquery",
|
||||||
|
"version": "2.0.0",
|
||||||
|
"description": "jQuery component",
|
||||||
|
"keywords": ["jquery"],
|
||||||
|
"main": "./jquery.js"
|
||||||
|
}
|
25
manifest.json
Executable file
25
manifest.json
Executable file
@ -0,0 +1,25 @@
|
|||||||
|
{
|
||||||
|
"name": "Fox.ci",
|
||||||
|
"version": "0.0.1",
|
||||||
|
"manifest_version": 2,
|
||||||
|
"description": "Fox.ci URL Shortener",
|
||||||
|
"homepage_url": "http://fox.ci",
|
||||||
|
"icons": {
|
||||||
|
"16": "icons/icon16.png",
|
||||||
|
"48": "icons/icon48.png",
|
||||||
|
"128": "icons/icon128.png"
|
||||||
|
},
|
||||||
|
"default_locale": "en",
|
||||||
|
|
||||||
|
"browser_action": {
|
||||||
|
"default_icon": "icons/icon19.png",
|
||||||
|
"default_title": "browser action demo",
|
||||||
|
"default_popup": "src/browser_action/browser_action.html"
|
||||||
|
},
|
||||||
|
"permissions": [
|
||||||
|
"clipboardRead",
|
||||||
|
"clipboardWrite",
|
||||||
|
"tabs",
|
||||||
|
"http://fox.ci/*"
|
||||||
|
]
|
||||||
|
}
|
6
src/bg/background.html
Executable file
6
src/bg/background.html
Executable file
@ -0,0 +1,6 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<script type="text/javascript" src="background.js"></script>
|
||||||
|
</head>
|
||||||
|
</html>
|
13
src/bg/background.js
Executable file
13
src/bg/background.js
Executable file
@ -0,0 +1,13 @@
|
|||||||
|
// if you checked "fancy-settings" in extensionizr.com, uncomment this lines
|
||||||
|
|
||||||
|
// var settings = new Store("settings", {
|
||||||
|
// "sample_setting": "This is how you use Store.js to remember values"
|
||||||
|
// });
|
||||||
|
|
||||||
|
|
||||||
|
//example of using a message handler from the inject scripts
|
||||||
|
chrome.extension.onMessage.addListener(
|
||||||
|
function(request, sender, sendResponse) {
|
||||||
|
chrome.pageAction.show(sender.tab.id);
|
||||||
|
sendResponse();
|
||||||
|
});
|
18
src/browser_action/browser_action.html
Executable file
18
src/browser_action/browser_action.html
Executable file
@ -0,0 +1,18 @@
|
|||||||
|
<!DOCTYPE html> <!-- The new doctype -->
|
||||||
|
<html>
|
||||||
|
<head> <!-- No title and meta tags are necessary for the extension -->
|
||||||
|
|
||||||
|
<link rel="stylesheet" type="text/css" href="style.css" />
|
||||||
|
<script src="jquery.js"></script> <!-- Including jQuery -->
|
||||||
|
<script src="popup.js"></script> <!-- Our script file -->
|
||||||
|
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<div id="content">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
8755
src/browser_action/jquery.js
vendored
Executable file
8755
src/browser_action/jquery.js
vendored
Executable file
File diff suppressed because it is too large
Load Diff
63
src/browser_action/popup.js
Normal file
63
src/browser_action/popup.js
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
var currentURL;
|
||||||
|
|
||||||
|
window.onload = function () {
|
||||||
|
|
||||||
|
|
||||||
|
// alert('The browser action was clicked! Yay!');
|
||||||
|
|
||||||
|
|
||||||
|
chrome.tabs.query({active: true, currentWindow: true}, function(arrayOfTabs) {
|
||||||
|
|
||||||
|
// since only one tab should be active and in the current window at once
|
||||||
|
// the return variable should only have one entry
|
||||||
|
var activeTab = arrayOfTabs[0];
|
||||||
|
var activeTabId = arrayOfTabs[0].id; // or do whatever you need
|
||||||
|
var activeTabURL = arrayOfTabs[0].url;
|
||||||
|
//document.write(activeTabURL);
|
||||||
|
currentURL = activeTabURL;
|
||||||
|
//$("#content").append("activeTabURL: "+activeTabURL+"<br>");
|
||||||
|
|
||||||
|
//$("#content").append("currentURL: "+currentURL+"<br>");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$.get( "http://fox.ci/api/?url="+currentURL )
|
||||||
|
.done(function( data ) {
|
||||||
|
//alert( "Data Loaded: " + data );
|
||||||
|
|
||||||
|
var obj = jQuery.parseJSON(data);
|
||||||
|
|
||||||
|
if((obj.statuscode==="100")||(obj.statuscode==="101")){
|
||||||
|
//document.write("Success! Our short URL is: "+obj.shorturl);
|
||||||
|
//$("#content").append("Short URL: <input type=\"text\" id=\"copyBox\" value=\""+obj.shorturl+"\"><br>");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
var copyFrom = $('<textarea/>');
|
||||||
|
copyFrom.text(obj.shorturl);
|
||||||
|
$('body').append(copyFrom);
|
||||||
|
copyFrom.select();
|
||||||
|
document.execCommand('copy');
|
||||||
|
//copyFrom.remove();
|
||||||
|
|
||||||
|
$("#content").append("Fox.ci ShortURL copied to clipboard!<br>");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}else{
|
||||||
|
document.write("nuuu something went wrong and it failed");
|
||||||
|
}
|
||||||
|
//document.write("<br>"+obj.statuscode);
|
||||||
|
//document.write(obj.statusdescription);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
//$("#content").append("Current URL: "+currentURL+"<br>");
|
||||||
|
//$("mainPopup").append('Test');
|
||||||
|
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user