diff --git a/.github/workflows/manual-generate-zip.yml b/.github/workflows/manual-generate-zip.yml new file mode 100644 index 0000000..d7c536c --- /dev/null +++ b/.github/workflows/manual-generate-zip.yml @@ -0,0 +1,26 @@ +# This is a basic workflow that is manually triggered + +name: Generate Browser Zip Files + +# Controls when the action will run. Workflow runs when manually triggered using the UI +# or API. +on: + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + generate-zips: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Build with build.sh + run: ./build.sh + - name: Setting date and time in env variable + run: echo "date-time-env=$(date '+%Y%m%d-%H%M%S')" >> $GITHUB_ENV + - uses: actions/upload-artifact@v3 + name: Uploading generated zip files + with: + name: zips-${{ github.ref_name }}-${{ env.date-time-env }} + path: generated/*.zip diff --git a/.github/workflows/pr-zip-generate.yml b/.github/workflows/pr-zip-generate.yml new file mode 100644 index 0000000..6c583e9 --- /dev/null +++ b/.github/workflows/pr-zip-generate.yml @@ -0,0 +1,26 @@ +name: PR to main branch zip generate + +on: + pull_request: + branches: [ "main" ] + paths: + - 'base/**' + - 'src/**' + - 'build.xml' + +jobs: + pr-generate-zips: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Build with build.sh + run: ./build.sh + - name: Setting date and time in env variable + run: echo "date-time-env=$(date '+%Y%m%d-%H%M%S')" >> $GITHUB_ENV + - uses: actions/upload-artifact@v3 + name: Uploading generated zip files + with: + name: pr-zips-${{ env.date-time-env }} + path: generated/*.zip diff --git a/.github/workflows/release-zip-upload.yml b/.github/workflows/release-zip-upload.yml new file mode 100644 index 0000000..a7b12d6 --- /dev/null +++ b/.github/workflows/release-zip-upload.yml @@ -0,0 +1,32 @@ +name: Auto zip Upload on Release Creation + +on: + release: + types: + - created + +permissions: + contents: write + +jobs: + build: + name: Upload Release Asset + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + - name: Build with build.sh + run: ./build.sh + - name: rename zips with version + run: | + mv -- generated/chrome-stt.zip generated/chrome-stt-${{ github.ref_name }}.zip + mv -- generated/firefox-stt.zip generated/firefox-stt-${{ github.ref_name }}.zip + - name: Upload generated Zip file + uses: softprops/action-gh-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + fail_on_unmatched_files: true + files: | + generated/chrome-stt-${{ github.ref_name }}.zip + generated/firefox-stt-${{ github.ref_name }}.zip diff --git a/Content.txt b/Content.txt deleted file mode 100644 index ee58aa7..0000000 --- a/Content.txt +++ /dev/null @@ -1,40 +0,0 @@ -Mobile Version: ------------------- -This is the mobile version of vastly used desktop version of Scroll To Top. -The link can be found here: http://goo.gl/HarJX - -Mobile version of this add-on is optimized for mobile devices, I've taken into consideration the valuable real-estate available on mobile screen. This add-on will not add any UI element on your browser until you scroll in upward direction. As soon as you scroll in upward direction, an icon will come at the bottom-right corner of the screen, clicking on that icon will take you to the top of the page. And yeah to remove it from your screen you just have to scroll a bit downwards. Believe me it is going to save a lot of time and efforts for you. :) - -You can enable animated scrolling from the settings page. - - -Desktop Version: ------------------- -Everyday scrolling on long pages can be a tiring experience specially on those sites which provides infinite scrolling (like facebook, twitter, Google+, etc). You will keep scrolling using your mouse to see more and more updates and then when you want to go up to the top of the page, you might move your hand from your mouse to keyboard to search for Home key or you will drag the scroll bar to the top. - -Scroll To Top tries to minimize this effort by providing an intuitive icon at the bottom-right corner of each page so that with one click you will be at the top of the page with beautiful animation. No more searching for Home key on your keyboard and no more dragging of the scroll bar. It will be just fun and ergonomic to use it. - -Official website: http://goo.gl/JtR42 - -Firefox Version: http://goo.gl/HarJX -Chrome Version: http://goo.gl/VTh5j -Safari Version: http://goo.gl/RaBrw -Opera Version: http://goo.gl/HMNnD - -Consider Donation (It helps): http://goo.gl/8Nl3M - -Icon Information: ------------------- -http://www.iconarchive.com/show/100-flat-2-icons-by-graphicloads/arrow-up-icon.html -http://www.iconarchive.com/show/colorful-long-shadow-icons-by-graphicloads/Arrow-up-icon.html -http://www.iconarchive.com/show/colorful-long-shadow-icons-by-graphicloads/Hand-thumbs-up-like-2-icon.html -http://www.iconarchive.com/show/colorful-long-shadow-icons-by-graphicloads/Hand-thumbs-up-like-icon.html -http://www.iconarchive.com/show/colorful-long-shadow-icons-by-graphicloads/Hand-thumbs-up-3-icon.html -http://www.iconarchive.com/show/colorful-long-shadow-icons-by-graphicloads/Arrow-upload-2-icon.html -http://www.iconarchive.com/show/colorful-long-shadow-icons-by-graphicloads/Button-eject-icon.html -http://www.iconarchive.com/show/colorful-long-shadow-icons-by-graphicloads/Drop-icon.html -http://www.iconarchive.com/show/colorful-long-shadow-icons-by-graphicloads/Envelope-icon.html -http://www.iconarchive.com/show/colorful-long-shadow-icons-by-graphicloads/Home-icon.html -http://www.iconarchive.com/show/windows-8-icons-by-icons8/User-Interface-Swipe-Up-icon.html -http://www.iconarchive.com/show/windows-8-icons-by-icons8/Arrows-Left-Round-icon.html -http://www.iconarchive.com/show/windows-8-icons-by-icons8/Arrows-Up-Circular-icon.html \ No newline at end of file diff --git a/README.md b/README.md index 06a6e1e..1a71bcf 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# Scroll To Top +# Scroll To Top -Scroll to top and vice versa in a desktop browser. A browser extension for Chrome, Firefox, Safari, Opera. +Scroll to top and vice versa in a desktop browser. A browser extension for Chrome, Firefox. [Release Notes](https://github.com/pratikabu/scrolltotop/releases) | [@scrolltotop](https://twitter.com/scrolltotop) | [Discuss](https://github.com/pratikabu/scrolltotop/discussions) @@ -21,14 +21,10 @@ Scroll to top and vice versa in a desktop browser. A browser extension for Chrom - Support development by [Donating](https://pratikabu.com/donate). - Help me translate the addon. -## How to Build: -Currently the build system is based on Apache Ant. -- Load the ants/build.xml file in the Ant view. -- Execute the respective browser task. -- You can also run ant on ants/build.xml directly, in this case it will generate the deployment code for all browsers. -- This can then be used in respective browsers to load as a temporary extension. - - +## How to Run: +- The `src` folder contains all the code to be used in any Chromium browsers to load as a temporary extension. +- To debug for Firefox, use the `firefox` folder in the `generated` folder. + - You'll have to run `./build.sh` to generate the `generated` folder. ## Bookmarklet If someone does not like installing an extension. Then you can create this Bookmark in your bookmark toolbar. @@ -40,4 +36,7 @@ This bookmarklet will scroll up or down based on the location of your screen. javascript:(function () {var paBody = document.body, paHtml = document.documentElement, paMaxY = Math.max(paBody.scrollHeight, paBody.offsetHeight, paHtml.clientHeight, paHtml.scrollHeight, paHtml.offsetHeight) - window.innerHeight, paBreakPoint = 300; if(window.scrollY > paBreakPoint || paBreakPoint >= paMaxY && window.scrollY != 0) window.scroll({top: 0, behavior: 'smooth'}); else window.scroll({top: paMaxY, behavior: 'smooth'});})(); ``` +There is a no-permission version of this extension, if someone is concerned about the permissions that this extension requires. +https://github.com/pratikabu/scrolltotop-lite + Read more about the [author](https://pratikabu.com). diff --git a/ants/build-browser.properties b/ants/build-browser.properties deleted file mode 100644 index f60b003..0000000 --- a/ants/build-browser.properties +++ /dev/null @@ -1,29 +0,0 @@ -#my props -base=../base -icons=${base}/icons - -options=${base}/options -resFolderName=res -optionsRes=${options}/${resFolderName} - -sttJsFileName=pratikabu-stt.js -sttCssFileName=pratikabu-stt.css - -optionHtmlFileName=options.html -optionJsFileName=options.js -optionCssFileName=options.css - -bsFolderName=browserspecific -bSpecific=../${bsFolderName} -bsOptionsImplName=options-browser-impl.js -bsSTTImpl=pratikabu-stt-impl.js - -generateDir=../generated -generatedZipDir=${generateDir}/zip-deploy - -htmlModifierJarFile=htmlModifier-2.1.jar - -ignoreFolderName=ignore - -browserKey=var BROWSER_KEY = "chrome" -replaceBrowserKey=var BROWSER_KEY = "${browserName}" \ No newline at end of file diff --git a/ants/build-browser.xml b/ants/build-browser.xml deleted file mode 100644 index 5c04840..0000000 --- a/ants/build-browser.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ants/build-chrome.properties b/ants/build-chrome.properties deleted file mode 100644 index 93b7cde..0000000 --- a/ants/build-chrome.properties +++ /dev/null @@ -1,12 +0,0 @@ -#my props -browserName=chrome -browserSubDir= -browserDir=${generateDir}/${browserName} -browserOptions=${browserDir}/options -browserSpecific=${browserDir}/${bsFolderName} - -baseBrowserSpecific=${bSpecific}/${browserName} - -browserMainDestJSLoc=${browserDir}/background.js - -deployExtension=zip \ No newline at end of file diff --git a/ants/build-chrome.xml b/ants/build-chrome.xml deleted file mode 100644 index 3f4fc85..0000000 --- a/ants/build-chrome.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ants/build-firefox.properties b/ants/build-firefox.properties deleted file mode 100644 index 7067497..0000000 --- a/ants/build-firefox.properties +++ /dev/null @@ -1,19 +0,0 @@ -#my props -browserName=firefox -browserSubDir= -browserDir=${generateDir}/${browserName} -browserOptions=${browserDir}/options -browserSpecific=${browserDir}/${bsFolderName} - -baseBrowserSpecific=${bSpecific}/chrome - -backgroundFile=background.js -browserMainDestJSLoc=${browserDir}/${backgroundFile} - -deployExtension=zip -browserSpeceficReviewUrl=https://addons.mozilla.org/en-us/firefox/addon/scroll-to-top/reviews - -manifestFileFFV2=manifest-ff-v2.json -manifestFile=manifest.json -searchManifestLine="author": "Pratik Soni", -replaceManifestLine=${searchManifestLine} "applications": {"gecko": {"id": "jid0-gRmSxW9ByuHwGjLhtXJg27YnZRs@jetpack"}}, \ No newline at end of file diff --git a/ants/build-firefox.xml b/ants/build-firefox.xml deleted file mode 100644 index 0514d54..0000000 --- a/ants/build-firefox.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ants/build-opera-chromium.properties b/ants/build-opera-chromium.properties deleted file mode 100644 index d4d937f..0000000 --- a/ants/build-opera-chromium.properties +++ /dev/null @@ -1,17 +0,0 @@ -#my props -browserName=opera-chromium -browserSubDir= -browserDir=${generateDir}/${browserName} -browserOptions=${browserDir}/options -browserSpecific=${browserDir}/${bsFolderName} - -baseBrowserSpecific=${bSpecific}/chrome - -backgroundFile=background.js -browserMainDestJSLoc=${browserDir}/${backgroundFile} - -deployExtension=zip -browserSpeceficReviewUrl=https://addons.opera.com/en/extensions/details/scroll-to-top - -searchStorageLine=return chrome.storage.sync -replaceStorageLine=return chrome.storage.local \ No newline at end of file diff --git a/ants/build-opera-chromium.xml b/ants/build-opera-chromium.xml deleted file mode 100644 index 4d31d36..0000000 --- a/ants/build-opera-chromium.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ants/build-safari.safariextension.properties b/ants/build-safari.safariextension.properties deleted file mode 100644 index 05c60a0..0000000 --- a/ants/build-safari.safariextension.properties +++ /dev/null @@ -1,12 +0,0 @@ -#my props -browserName=safari.safariextension -browserSubDir= -browserDir=${generateDir}/${browserName} -browserOptions=${browserDir}/options -browserSpecific=${browserDir}/${bsFolderName} - -baseBrowserSpecific=${bSpecific}/${browserName} - -browserMainDestJSLoc=${browserDir}/background.js - -deployExtension=zip \ No newline at end of file diff --git a/ants/build-safari.safariextension.xml b/ants/build-safari.safariextension.xml deleted file mode 100644 index 965b525..0000000 --- a/ants/build-safari.safariextension.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ants/build.properties b/ants/build.properties deleted file mode 100644 index dccdc7d..0000000 --- a/ants/build.properties +++ /dev/null @@ -1,4 +0,0 @@ -builBrowserCommon=build-browser -buildBrowserFileName=${builBrowserCommon}.xml -buildBrowserPropFileName=${builBrowserCommon}.properties -chromeReviewUrl=https://chrome.google.com/webstore/detail/scroll-to-top/hegiignepmecppikdlbohnnbfjdoaghj/reviews \ No newline at end of file diff --git a/ants/build.xml b/ants/build.xml deleted file mode 100644 index 284dc97..0000000 --- a/ants/build.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ants/htmlModifier-2.1.jar b/ants/htmlModifier-2.1.jar deleted file mode 100644 index ed17d38..0000000 Binary files a/ants/htmlModifier-2.1.jar and /dev/null differ diff --git a/base/icons/pratikabu-stt-64.png b/base/icons/pratikabu-stt-64.png deleted file mode 100644 index 74b23fc..0000000 Binary files a/base/icons/pratikabu-stt-64.png and /dev/null differ diff --git a/browserspecific/chrome/browserspecific/options-browser-impl.js b/browserspecific/chrome/browserspecific/options-browser-impl.js deleted file mode 100644 index 03a6f10..0000000 --- a/browserspecific/chrome/browserspecific/options-browser-impl.js +++ /dev/null @@ -1,51 +0,0 @@ -/************************************************************ - Browser specific coding -************************************************************/ - -/** Saves options to localStorage. */ -function bsDefaultSettings() { - chrome.runtime.sendMessage({method: "resetSettings"}, function(status) { - if("success" === status) { - // Update status to let user know options were defaulted. - bsFetchSettings(post_restore_success); - - bsResetToolbarIcon(); - } - }); -} - -function bsInit() { -} - -function bsFetchSettings(methodToExecute) { - chrome.runtime.sendMessage({method: "fetchSettings"}, function(respSttData) { - restore_options(respSttData); - if(methodToExecute) - methodToExecute(); - }); -} - -function bsSaveSettings(data) { - chrome.runtime.sendMessage({method: "saveSettings", "sttData": data}, function(status) { - if("success" === status) { - // Update status to let user know options were saved. - post_save_success(); - } - }); -} - -$( document ).ready(function() { - psInitJavascriptFunctions(); -}); - -function getExtensionVersion() { - return chrome.runtime.getManifest().version; -} - -function bsResetToolbarIcon() { - chrome.runtime.sendMessage({method: "resetToolbarIcon"}); -} - -function bsResetContextMenu(showContextMenu) { - chrome.runtime.sendMessage({method: "resetContextMenu", showContextMenu: showContextMenu}); -} diff --git a/browserspecific/chrome/browserspecific/pratikabu-stt-impl.js b/browserspecific/chrome/browserspecific/pratikabu-stt-impl.js deleted file mode 100644 index 9f0828e..0000000 --- a/browserspecific/chrome/browserspecific/pratikabu-stt-impl.js +++ /dev/null @@ -1,42 +0,0 @@ -var pratikabustt_browser_impl = { - getFixedLocation : function() { - // #BrowserSpecific location - return "icons/pratikabu-stt-"; - }, - - fetchPreferences: function() { - chrome.runtime.sendMessage({method: "fetchSettings"}, function(response_msg) { - pratikabustt.loadFromResponse(response_msg); - }); - }, - - getBrowserSpecificUrl: function(imgUrl) { - // #BrowserSpecific method to get the resource - return chrome.runtime.getURL(imgUrl); - }, - - openOptionPage: function() { - // #BrowserSpecific method to open the option page - chrome.runtime.sendMessage({method: "openOptionPage"}); - }, - - setImageForId: function(imgId, imageName) { - var imgUrl = pratikabustt_browser_impl.getFixedLocation() + imageName; - $("#" + imgId).attr("src", pratikabustt_browser_impl.getBrowserSpecificUrl(imgUrl)); - }, - - /** - Remove all excess code required for - */ - removeCompleteAddOnCode: function() { - } -}; - -chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) { - if(request.pratikabusttaction == "top") - pratikabustt.scrollToTop(); - else if (request.pratikabusttaction == "intelligentflip") - pratikabustt.scrollIntelligently(); - else if(request.pratikabusttaction == "bottom") - pratikabustt.scrollToBottom(); -}); diff --git a/browserspecific/safari.safariextension/Icon-64.png b/browserspecific/safari.safariextension/Icon-64.png deleted file mode 100644 index 74b23fc..0000000 Binary files a/browserspecific/safari.safariextension/Icon-64.png and /dev/null differ diff --git a/browserspecific/safari.safariextension/Info.plist b/browserspecific/safari.safariextension/Info.plist deleted file mode 100644 index 9b7927d..0000000 --- a/browserspecific/safari.safariextension/Info.plist +++ /dev/null @@ -1,73 +0,0 @@ - - - - - Author - Pratik Soni - Builder Version - 534.57.2 - CFBundleDisplayName - Scroll To Top - CFBundleIdentifier - net.sf.users.pratikabu.stt - CFBundleInfoDictionaryVersion - 6.0 - CFBundleShortVersionString - 4.5 - CFBundleVersion - 4.5 - Chrome - - Context Menu Items - - - Command - openOptionPage - Identifier - configureSTT - Title - Configure Scroll To Top - - - Database Quota - 5242880 - Global Page - background.html - - Content - - Scripts - - End - - thirdparty/pratikabu-jquery.js - thirdparty/pratikabu-jquery-rotate.js - browserspecific/pratikabu-stt-impl.js - pratikabu-stt.js - - - Stylesheets - - pratikabu-stt.css - - - Description - Scroll to top and vice versa in a window. - ExtensionInfoDictionaryVersion - 1.0 - Permissions - - Website Access - - Include Secure Pages - - Level - All - - - Update Manifest URL - https://scrolltotop.pratikabu.com/res/scroll-to-top-safari-update.plist - Website - https://scrolltotop.pratikabu.com - - diff --git a/browserspecific/safari.safariextension/Settings.plist b/browserspecific/safari.safariextension/Settings.plist deleted file mode 100644 index 3beebb7..0000000 --- a/browserspecific/safari.safariextension/Settings.plist +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - Title - To configure Scroll To Top right-click on the web page. - Type - Group - - - Type - Separator - - - Title - Select the Configure Scroll To Top button from the menu. - Type - Group - - - Type - Separator - - - DefaultValue - 0.0 - Key - version_info - - - diff --git a/browserspecific/safari.safariextension/background.html b/browserspecific/safari.safariextension/background.html deleted file mode 100644 index d767472..0000000 --- a/browserspecific/safari.safariextension/background.html +++ /dev/null @@ -1,211 +0,0 @@ - \ No newline at end of file diff --git a/browserspecific/safari.safariextension/browserspecific/options-browser-impl.js b/browserspecific/safari.safariextension/browserspecific/options-browser-impl.js deleted file mode 100644 index 0cd6beb..0000000 --- a/browserspecific/safari.safariextension/browserspecific/options-browser-impl.js +++ /dev/null @@ -1,39 +0,0 @@ -/************************************************************ - Browser specific coding -************************************************************/ - -/** Saves options to localStorage. */ -function bsDefaultSettings() { - safari.self.tab.dispatchMessage("resetSettings"); -} - -function bsInit() { - safari.self.addEventListener("message", function(theMessageEvent) { - if("resetCompleted" === theMessageEvent.name) { - bsFetchSettings(); - // Update status to let user know options were defaulted. - post_restore_success(); - } else if("optionPagePreferences" === theMessageEvent.name) { - restore_options(theMessageEvent.message); - } else if("saveCompleted" === theMessageEvent.name) { - // Update status to let user know options were saved. - post_save_success(); - } - }, false); -} - -function bsFetchSettings() { - safari.self.tab.dispatchMessage("requestSettings", true); -} - -function bsSaveSettings(data) { - safari.self.tab.dispatchMessage("saveSettings", data); -} - -function bsReviewPageUrl() { - return "https://blog.pratikabu.com/2013/02/scroll-to-top-review-from-safari-users.html"; -} - -document.addEventListener('DOMContentLoaded', function () { - psInitJavascriptFunctions(); -}); \ No newline at end of file diff --git a/browserspecific/safari.safariextension/browserspecific/pratikabu-stt-impl.js b/browserspecific/safari.safariextension/browserspecific/pratikabu-stt-impl.js deleted file mode 100644 index 0a055b1..0000000 --- a/browserspecific/safari.safariextension/browserspecific/pratikabu-stt-impl.js +++ /dev/null @@ -1,48 +0,0 @@ -var pratikabustt_browser_impl = { - getFixedLocation : function() { - // #BrowserSpecific location - return safari.extension.baseURI + "icons/pratikabu-stt-"; - }, - - fetchPreferences: function() { - // #BrowserSpecific method call - // logic to set the location - safari.self.addEventListener("message", pratikabustt_browser_impl.loadFromPreference, false); - safari.self.tab.dispatchMessage("requestSettings"); - }, - - loadFromPreference: function(data) { - // #BrowserSpecific this method is somewhat browser specific - if(!data) { - return; - } - pratikabustt.loadFromResponse(pratikabustt_browser_impl.convertResponse(data)); - }, - - getBrowserSpecificUrl: function(imgUrl) { - // #BrowserSpecific method to get the resource - return imgUrl; - }, - - convertResponse: function(rawResponse) { - // #BrowserSpecific method to convert response to single known format - var response = rawResponse.message; - return response; - }, - - openOptionPage: function() { - // #BrowserSpecific method to open the option page - safari.self.tab.dispatchMessage("optionPage");// method to communicate to background.html - }, - - setImageForId: function(imgId, imageName) { - var imgUrl = pratikabustt_browser_impl.getFixedLocation() + imageName; - $("#" + imgId).attr("src", pratikabustt_browser_impl.getBrowserSpecificUrl(imgUrl)); - }, - - /** - Remove all excess code required for - */ - removeCompleteAddOnCode: function() { - } -}; \ No newline at end of file diff --git a/browserspecific/safari.safariextension/ignore/HowToCreateSfariCertificate.pdf b/browserspecific/safari.safariextension/ignore/HowToCreateSfariCertificate.pdf deleted file mode 100644 index 88ac7f1..0000000 Binary files a/browserspecific/safari.safariextension/ignore/HowToCreateSfariCertificate.pdf and /dev/null differ diff --git a/browserspecific/safari.safariextension/ignore/certificateHowTo.txt b/browserspecific/safari.safariextension/ignore/certificateHowTo.txt deleted file mode 100644 index e2355bb..0000000 --- a/browserspecific/safari.safariextension/ignore/certificateHowTo.txt +++ /dev/null @@ -1,5 +0,0 @@ -Run this: -certreq -new \certreq.txt - -It will generate one pem file. -Use that pem file to generate Safari Certificate. \ No newline at end of file diff --git a/browserspecific/safari.safariextension/ignore/certreq.txt b/browserspecific/safari.safariextension/ignore/certreq.txt deleted file mode 100644 index ffa280f..0000000 --- a/browserspecific/safari.safariextension/ignore/certreq.txt +++ /dev/null @@ -1,5 +0,0 @@ -[NewRequest] -Subject="cn=Safari Developer,o=User" -RequestType=pkcs10 -KeyLength=2048 -Exportable=TRUE \ No newline at end of file diff --git a/browserspecific/safari.safariextension/ignore/scroll-to-top-safari-update.plist b/browserspecific/safari.safariextension/ignore/scroll-to-top-safari-update.plist deleted file mode 100644 index 8defb8f..0000000 --- a/browserspecific/safari.safariextension/ignore/scroll-to-top-safari-update.plist +++ /dev/null @@ -1,21 +0,0 @@ - - - - - Extension Updates - - - CFBundleIdentifier - net.sf.users.pratikabu.stt - Developer Identifier - E5WB5T4538 - CFBundleVersion - 4.5 - CFBundleShortVersionString - 4.5 - URL - http://pratikabu.users.sourceforge.net/extensions/scrolltotop/safaridownload.php - - - - \ No newline at end of file diff --git a/browserspecific/safari.safariextension/ignore/updateProcess.txt b/browserspecific/safari.safariextension/ignore/updateProcess.txt deleted file mode 100644 index 256d9a5..0000000 --- a/browserspecific/safari.safariextension/ignore/updateProcess.txt +++ /dev/null @@ -1,6 +0,0 @@ -Make the changes and create the scroll-to-top-x.y.safariextz -upload it to dropbox.com or any other place -make the goo.gl url for this - -Update the update.plist file with proper version -upload it to res folder in my website \ No newline at end of file diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..85bc742 --- /dev/null +++ b/build.sh @@ -0,0 +1,26 @@ +GENERATED=generated + +echo "Cleaning $GENERATED folder" +rm -rf $GENERATED +mkdir -p $GENERATED + +echo "Building for Chrome" +cd src +zip -rq ../$GENERATED/chrome-stt.zip * -x "*.DS_Store" +cd .. + +echo "Building for Firefox" +FIREFOX=$GENERATED/firefox +mkdir -p $FIREFOX +echo "Copying src to $FIREFOX folder" +cp -r src/. $FIREFOX/ + +echo "Manipulating files" +cd $FIREFOX +rm -f manifest.json +cp ../../resources/manifest-ff-v2.json manifest.json +sed -i '' -e 's/chrome.action./chrome.browserAction./g' background.js + +zip -rq ../firefox-stt.zip * -x "*.DS_Store" +cd ../.. +echo "Build Completed" diff --git a/rdmd-res/generated-folder-structure.png b/rdmd-res/generated-folder-structure.png deleted file mode 100644 index be42919..0000000 Binary files a/rdmd-res/generated-folder-structure.png and /dev/null differ diff --git a/rdmd-res/pratikabu-stt-256.png b/rdmd-res/pratikabu-stt-256.png deleted file mode 100755 index fbad618..0000000 Binary files a/rdmd-res/pratikabu-stt-256.png and /dev/null differ diff --git a/resources/README.md b/resources/README.md new file mode 100644 index 0000000..c7f83b5 --- /dev/null +++ b/resources/README.md @@ -0,0 +1,63 @@ +# Resources & References + +## Text Content +Everyday scrolling on long pages can be a tiring experience specially on those sites which provides infinite scrolling (like facebook, twitter, etc). You will keep scrolling using your mouse to see more and more updates and then when you want to go up to the top of the page, you might move your hand from your mouse to keyboard to search for Home key or you will drag the scroll bar to the top. + +Scroll To Top tries to minimize this effort by providing an intuitive icon at the bottom-right corner of each page so that with one click you will be at the top of the page with beautiful animation. No more searching for Home key on your keyboard and no more dragging of the scroll bar. It will be just fun and ergonomic to use it. + +GitHub Rep: https://github.com/pratikabu/scrolltotop
+Release notes: https://github.com/pratikabu/scrolltotop/releases + + +## Icon Sources + +| Icon | Comment | +| ---- | ------ | +| | https://www.softicons.com/toolbar-icons/vista-arrow-icons-by-icons-land/up-blue-icon | +| | NA | +| | NA | +| | NA | +| | NA | +| | NA | +| | NA | +| | NA | +| | NA | +| | https://iconarchive.com/show/comic-3-icons-by-fasticon/up-icon.html | +| | https://iconarchive.com/show/oxygen-icons-by-oxygen-icons.org/Actions-arrow-up-double-icon.html | +| | NA | +| | https://iconarchive.com/show/blue-bits-icons-by-icojam/arrow-up-icon.html | +| | NA | +| | NA | +| | NA | +| | NA | +| | NA | +| | NA | +| | NA | +| | NA | +| | NA | +| | NA | +| | https://iconarchive.com/show/colorful-long-shadow-icons-by-graphicloads/Button-eject-icon.html | +| | https://iconarchive.com/show/colorful-long-shadow-icons-by-graphicloads/Drop-icon.html | +| | https://iconarchive.com/show/colorful-long-shadow-icons-by-graphicloads/Envelope-icon.html | +| | https://iconarchive.com/show/colorful-long-shadow-icons-by-graphicloads/Hand-thumbs-up-3-icon.html | +| | https://iconarchive.com/show/colorful-long-shadow-icons-by-graphicloads/Hand-thumbs-up-like-2-icon.html | +| | https://iconarchive.com/show/colorful-long-shadow-icons-by-graphicloads/Hand-thumbs-up-like-icon.html | +| | https://iconarchive.com/show/colorful-long-shadow-icons-by-graphicloads/Home-icon.html | +| | https://iconarchive.com/show/windows-8-icons-by-icons8/Arrows-Left-Round-icon.html | +| | https://iconarchive.com/show/windows-8-icons-by-icons8/Arrows-Up-Circular-icon.html | +| | https://iconarchive.com/show/100-flat-2-icons-by-graphicloads/arrow-up-icon.html | +| | https://iconarchive.com/show/colorful-long-shadow-icons-by-graphicloads/Arrow-up-icon.html | +| | https://iconarchive.com/show/colorful-long-shadow-icons-by-graphicloads/Arrow-upload-2-icon.html | +| | https://iconarchive.com/show/basic-2-icons-by-pixelmixer/arrow-up-icon.html | +| | NA | +| | NA | +| | NA | +| | NA | +| | NA | +| | NA | +| | NA | +| | https://iconarchive.com/show/oxygen-icons-by-oxygen-icons.org/Actions-arrow-up-icon.html | +| | NA | +| | NA | +| | NA | +| | NA | diff --git a/browserspecific/chrome/manifest-ff-v2.json b/resources/manifest-ff-v2.json similarity index 95% rename from browserspecific/chrome/manifest-ff-v2.json rename to resources/manifest-ff-v2.json index 88bd6df..49803a8 100644 --- a/browserspecific/chrome/manifest-ff-v2.json +++ b/resources/manifest-ff-v2.json @@ -22,7 +22,6 @@ "matches":[ "" ], "js":[ "thirdparty/pratikabu-jquery-3.2.1.min.js", - "browserspecific/pratikabu-stt-impl.js", "pratikabu-stt.js" ] } diff --git a/browserspecific/chrome/background.js b/src/background.js similarity index 100% rename from browserspecific/chrome/background.js rename to src/background.js diff --git a/base/icons/pratikabu-stt-128.png b/src/icons/pratikabu-stt-128.png similarity index 100% rename from base/icons/pratikabu-stt-128.png rename to src/icons/pratikabu-stt-128.png diff --git a/base/icons/pratikabu-stt-16.png b/src/icons/pratikabu-stt-16.png similarity index 100% rename from base/icons/pratikabu-stt-16.png rename to src/icons/pratikabu-stt-16.png diff --git a/base/icons/pratikabu-stt-32-1.png b/src/icons/pratikabu-stt-32-1.png similarity index 100% rename from base/icons/pratikabu-stt-32-1.png rename to src/icons/pratikabu-stt-32-1.png diff --git a/base/icons/pratikabu-stt-32-10.png b/src/icons/pratikabu-stt-32-10.png similarity index 100% rename from base/icons/pratikabu-stt-32-10.png rename to src/icons/pratikabu-stt-32-10.png diff --git a/base/icons/pratikabu-stt-32-11.png b/src/icons/pratikabu-stt-32-11.png similarity index 100% rename from base/icons/pratikabu-stt-32-11.png rename to src/icons/pratikabu-stt-32-11.png diff --git a/base/icons/pratikabu-stt-32-12.png b/src/icons/pratikabu-stt-32-12.png similarity index 100% rename from base/icons/pratikabu-stt-32-12.png rename to src/icons/pratikabu-stt-32-12.png diff --git a/base/icons/pratikabu-stt-32-13.png b/src/icons/pratikabu-stt-32-13.png similarity index 100% rename from base/icons/pratikabu-stt-32-13.png rename to src/icons/pratikabu-stt-32-13.png diff --git a/base/icons/pratikabu-stt-32-14.png b/src/icons/pratikabu-stt-32-14.png similarity index 100% rename from base/icons/pratikabu-stt-32-14.png rename to src/icons/pratikabu-stt-32-14.png diff --git a/base/icons/pratikabu-stt-32-15.png b/src/icons/pratikabu-stt-32-15.png similarity index 100% rename from base/icons/pratikabu-stt-32-15.png rename to src/icons/pratikabu-stt-32-15.png diff --git a/base/icons/pratikabu-stt-32-16.png b/src/icons/pratikabu-stt-32-16.png similarity index 100% rename from base/icons/pratikabu-stt-32-16.png rename to src/icons/pratikabu-stt-32-16.png diff --git a/base/icons/pratikabu-stt-32-17.png b/src/icons/pratikabu-stt-32-17.png similarity index 100% rename from base/icons/pratikabu-stt-32-17.png rename to src/icons/pratikabu-stt-32-17.png diff --git a/base/icons/pratikabu-stt-32-18.png b/src/icons/pratikabu-stt-32-18.png similarity index 100% rename from base/icons/pratikabu-stt-32-18.png rename to src/icons/pratikabu-stt-32-18.png diff --git a/base/icons/pratikabu-stt-32-19.png b/src/icons/pratikabu-stt-32-19.png similarity index 100% rename from base/icons/pratikabu-stt-32-19.png rename to src/icons/pratikabu-stt-32-19.png diff --git a/base/icons/pratikabu-stt-32-2.png b/src/icons/pratikabu-stt-32-2.png similarity index 100% rename from base/icons/pratikabu-stt-32-2.png rename to src/icons/pratikabu-stt-32-2.png diff --git a/base/icons/pratikabu-stt-32-20.png b/src/icons/pratikabu-stt-32-20.png similarity index 100% rename from base/icons/pratikabu-stt-32-20.png rename to src/icons/pratikabu-stt-32-20.png diff --git a/base/icons/pratikabu-stt-32-21.png b/src/icons/pratikabu-stt-32-21.png similarity index 100% rename from base/icons/pratikabu-stt-32-21.png rename to src/icons/pratikabu-stt-32-21.png diff --git a/base/icons/pratikabu-stt-32-22.png b/src/icons/pratikabu-stt-32-22.png similarity index 100% rename from base/icons/pratikabu-stt-32-22.png rename to src/icons/pratikabu-stt-32-22.png diff --git a/base/icons/pratikabu-stt-32-23.png b/src/icons/pratikabu-stt-32-23.png similarity index 100% rename from base/icons/pratikabu-stt-32-23.png rename to src/icons/pratikabu-stt-32-23.png diff --git a/base/icons/pratikabu-stt-32-24.png b/src/icons/pratikabu-stt-32-24.png similarity index 100% rename from base/icons/pratikabu-stt-32-24.png rename to src/icons/pratikabu-stt-32-24.png diff --git a/base/icons/pratikabu-stt-32-25.png b/src/icons/pratikabu-stt-32-25.png similarity index 100% rename from base/icons/pratikabu-stt-32-25.png rename to src/icons/pratikabu-stt-32-25.png diff --git a/base/icons/pratikabu-stt-32-26.png b/src/icons/pratikabu-stt-32-26.png similarity index 100% rename from base/icons/pratikabu-stt-32-26.png rename to src/icons/pratikabu-stt-32-26.png diff --git a/base/icons/pratikabu-stt-32-27.png b/src/icons/pratikabu-stt-32-27.png similarity index 100% rename from base/icons/pratikabu-stt-32-27.png rename to src/icons/pratikabu-stt-32-27.png diff --git a/base/icons/pratikabu-stt-32-28.png b/src/icons/pratikabu-stt-32-28.png similarity index 100% rename from base/icons/pratikabu-stt-32-28.png rename to src/icons/pratikabu-stt-32-28.png diff --git a/base/icons/pratikabu-stt-32-29.png b/src/icons/pratikabu-stt-32-29.png similarity index 100% rename from base/icons/pratikabu-stt-32-29.png rename to src/icons/pratikabu-stt-32-29.png diff --git a/base/icons/pratikabu-stt-32-3.png b/src/icons/pratikabu-stt-32-3.png similarity index 100% rename from base/icons/pratikabu-stt-32-3.png rename to src/icons/pratikabu-stt-32-3.png diff --git a/base/icons/pratikabu-stt-32-30.png b/src/icons/pratikabu-stt-32-30.png similarity index 100% rename from base/icons/pratikabu-stt-32-30.png rename to src/icons/pratikabu-stt-32-30.png diff --git a/base/icons/pratikabu-stt-32-31.png b/src/icons/pratikabu-stt-32-31.png similarity index 100% rename from base/icons/pratikabu-stt-32-31.png rename to src/icons/pratikabu-stt-32-31.png diff --git a/base/icons/pratikabu-stt-32-32.png b/src/icons/pratikabu-stt-32-32.png similarity index 100% rename from base/icons/pratikabu-stt-32-32.png rename to src/icons/pratikabu-stt-32-32.png diff --git a/base/icons/pratikabu-stt-32-33.png b/src/icons/pratikabu-stt-32-33.png similarity index 100% rename from base/icons/pratikabu-stt-32-33.png rename to src/icons/pratikabu-stt-32-33.png diff --git a/base/icons/pratikabu-stt-32-34.png b/src/icons/pratikabu-stt-32-34.png similarity index 100% rename from base/icons/pratikabu-stt-32-34.png rename to src/icons/pratikabu-stt-32-34.png diff --git a/base/icons/pratikabu-stt-32-35.png b/src/icons/pratikabu-stt-32-35.png similarity index 100% rename from base/icons/pratikabu-stt-32-35.png rename to src/icons/pratikabu-stt-32-35.png diff --git a/base/icons/pratikabu-stt-32-4.png b/src/icons/pratikabu-stt-32-4.png similarity index 100% rename from base/icons/pratikabu-stt-32-4.png rename to src/icons/pratikabu-stt-32-4.png diff --git a/base/icons/pratikabu-stt-32-5.png b/src/icons/pratikabu-stt-32-5.png similarity index 100% rename from base/icons/pratikabu-stt-32-5.png rename to src/icons/pratikabu-stt-32-5.png diff --git a/base/icons/pratikabu-stt-32-6.png b/src/icons/pratikabu-stt-32-6.png similarity index 100% rename from base/icons/pratikabu-stt-32-6.png rename to src/icons/pratikabu-stt-32-6.png diff --git a/base/icons/pratikabu-stt-32-7.png b/src/icons/pratikabu-stt-32-7.png similarity index 100% rename from base/icons/pratikabu-stt-32-7.png rename to src/icons/pratikabu-stt-32-7.png diff --git a/base/icons/pratikabu-stt-32-8.png b/src/icons/pratikabu-stt-32-8.png similarity index 100% rename from base/icons/pratikabu-stt-32-8.png rename to src/icons/pratikabu-stt-32-8.png diff --git a/base/icons/pratikabu-stt-32-9.png b/src/icons/pratikabu-stt-32-9.png similarity index 100% rename from base/icons/pratikabu-stt-32-9.png rename to src/icons/pratikabu-stt-32-9.png diff --git a/base/icons/pratikabu-stt-48-1.png b/src/icons/pratikabu-stt-48-1.png similarity index 100% rename from base/icons/pratikabu-stt-48-1.png rename to src/icons/pratikabu-stt-48-1.png diff --git a/base/icons/pratikabu-stt-48-10.png b/src/icons/pratikabu-stt-48-10.png similarity index 100% rename from base/icons/pratikabu-stt-48-10.png rename to src/icons/pratikabu-stt-48-10.png diff --git a/base/icons/pratikabu-stt-48-11.png b/src/icons/pratikabu-stt-48-11.png similarity index 100% rename from base/icons/pratikabu-stt-48-11.png rename to src/icons/pratikabu-stt-48-11.png diff --git a/base/icons/pratikabu-stt-48-12.png b/src/icons/pratikabu-stt-48-12.png similarity index 100% rename from base/icons/pratikabu-stt-48-12.png rename to src/icons/pratikabu-stt-48-12.png diff --git a/base/icons/pratikabu-stt-48-13.png b/src/icons/pratikabu-stt-48-13.png similarity index 100% rename from base/icons/pratikabu-stt-48-13.png rename to src/icons/pratikabu-stt-48-13.png diff --git a/base/icons/pratikabu-stt-48-14.png b/src/icons/pratikabu-stt-48-14.png similarity index 100% rename from base/icons/pratikabu-stt-48-14.png rename to src/icons/pratikabu-stt-48-14.png diff --git a/base/icons/pratikabu-stt-48-15.png b/src/icons/pratikabu-stt-48-15.png similarity index 100% rename from base/icons/pratikabu-stt-48-15.png rename to src/icons/pratikabu-stt-48-15.png diff --git a/base/icons/pratikabu-stt-48-16.png b/src/icons/pratikabu-stt-48-16.png similarity index 100% rename from base/icons/pratikabu-stt-48-16.png rename to src/icons/pratikabu-stt-48-16.png diff --git a/base/icons/pratikabu-stt-48-17.png b/src/icons/pratikabu-stt-48-17.png similarity index 100% rename from base/icons/pratikabu-stt-48-17.png rename to src/icons/pratikabu-stt-48-17.png diff --git a/base/icons/pratikabu-stt-48-18.png b/src/icons/pratikabu-stt-48-18.png similarity index 100% rename from base/icons/pratikabu-stt-48-18.png rename to src/icons/pratikabu-stt-48-18.png diff --git a/base/icons/pratikabu-stt-48-19.png b/src/icons/pratikabu-stt-48-19.png similarity index 100% rename from base/icons/pratikabu-stt-48-19.png rename to src/icons/pratikabu-stt-48-19.png diff --git a/base/icons/pratikabu-stt-48-2.png b/src/icons/pratikabu-stt-48-2.png similarity index 100% rename from base/icons/pratikabu-stt-48-2.png rename to src/icons/pratikabu-stt-48-2.png diff --git a/base/icons/pratikabu-stt-48-20.png b/src/icons/pratikabu-stt-48-20.png similarity index 100% rename from base/icons/pratikabu-stt-48-20.png rename to src/icons/pratikabu-stt-48-20.png diff --git a/base/icons/pratikabu-stt-48-21.png b/src/icons/pratikabu-stt-48-21.png similarity index 100% rename from base/icons/pratikabu-stt-48-21.png rename to src/icons/pratikabu-stt-48-21.png diff --git a/base/icons/pratikabu-stt-48-22.png b/src/icons/pratikabu-stt-48-22.png similarity index 100% rename from base/icons/pratikabu-stt-48-22.png rename to src/icons/pratikabu-stt-48-22.png diff --git a/base/icons/pratikabu-stt-48-23.png b/src/icons/pratikabu-stt-48-23.png similarity index 100% rename from base/icons/pratikabu-stt-48-23.png rename to src/icons/pratikabu-stt-48-23.png diff --git a/base/icons/pratikabu-stt-48-24.png b/src/icons/pratikabu-stt-48-24.png similarity index 100% rename from base/icons/pratikabu-stt-48-24.png rename to src/icons/pratikabu-stt-48-24.png diff --git a/base/icons/pratikabu-stt-48-25.png b/src/icons/pratikabu-stt-48-25.png similarity index 100% rename from base/icons/pratikabu-stt-48-25.png rename to src/icons/pratikabu-stt-48-25.png diff --git a/base/icons/pratikabu-stt-48-26.png b/src/icons/pratikabu-stt-48-26.png similarity index 100% rename from base/icons/pratikabu-stt-48-26.png rename to src/icons/pratikabu-stt-48-26.png diff --git a/base/icons/pratikabu-stt-48-27.png b/src/icons/pratikabu-stt-48-27.png similarity index 100% rename from base/icons/pratikabu-stt-48-27.png rename to src/icons/pratikabu-stt-48-27.png diff --git a/base/icons/pratikabu-stt-48-28.png b/src/icons/pratikabu-stt-48-28.png similarity index 100% rename from base/icons/pratikabu-stt-48-28.png rename to src/icons/pratikabu-stt-48-28.png diff --git a/base/icons/pratikabu-stt-48-29.png b/src/icons/pratikabu-stt-48-29.png similarity index 100% rename from base/icons/pratikabu-stt-48-29.png rename to src/icons/pratikabu-stt-48-29.png diff --git a/base/icons/pratikabu-stt-48-3.png b/src/icons/pratikabu-stt-48-3.png similarity index 100% rename from base/icons/pratikabu-stt-48-3.png rename to src/icons/pratikabu-stt-48-3.png diff --git a/base/icons/pratikabu-stt-48-30.png b/src/icons/pratikabu-stt-48-30.png similarity index 100% rename from base/icons/pratikabu-stt-48-30.png rename to src/icons/pratikabu-stt-48-30.png diff --git a/base/icons/pratikabu-stt-48-31.png b/src/icons/pratikabu-stt-48-31.png similarity index 100% rename from base/icons/pratikabu-stt-48-31.png rename to src/icons/pratikabu-stt-48-31.png diff --git a/base/icons/pratikabu-stt-48-32.png b/src/icons/pratikabu-stt-48-32.png similarity index 100% rename from base/icons/pratikabu-stt-48-32.png rename to src/icons/pratikabu-stt-48-32.png diff --git a/base/icons/pratikabu-stt-48-33.png b/src/icons/pratikabu-stt-48-33.png similarity index 100% rename from base/icons/pratikabu-stt-48-33.png rename to src/icons/pratikabu-stt-48-33.png diff --git a/base/icons/pratikabu-stt-48-34.png b/src/icons/pratikabu-stt-48-34.png similarity index 100% rename from base/icons/pratikabu-stt-48-34.png rename to src/icons/pratikabu-stt-48-34.png diff --git a/base/icons/pratikabu-stt-48-35.png b/src/icons/pratikabu-stt-48-35.png similarity index 100% rename from base/icons/pratikabu-stt-48-35.png rename to src/icons/pratikabu-stt-48-35.png diff --git a/base/icons/pratikabu-stt-48-4.png b/src/icons/pratikabu-stt-48-4.png similarity index 100% rename from base/icons/pratikabu-stt-48-4.png rename to src/icons/pratikabu-stt-48-4.png diff --git a/base/icons/pratikabu-stt-48-5.png b/src/icons/pratikabu-stt-48-5.png similarity index 100% rename from base/icons/pratikabu-stt-48-5.png rename to src/icons/pratikabu-stt-48-5.png diff --git a/base/icons/pratikabu-stt-48-6.png b/src/icons/pratikabu-stt-48-6.png similarity index 100% rename from base/icons/pratikabu-stt-48-6.png rename to src/icons/pratikabu-stt-48-6.png diff --git a/base/icons/pratikabu-stt-48-7.png b/src/icons/pratikabu-stt-48-7.png similarity index 100% rename from base/icons/pratikabu-stt-48-7.png rename to src/icons/pratikabu-stt-48-7.png diff --git a/base/icons/pratikabu-stt-48-8.png b/src/icons/pratikabu-stt-48-8.png similarity index 100% rename from base/icons/pratikabu-stt-48-8.png rename to src/icons/pratikabu-stt-48-8.png diff --git a/base/icons/pratikabu-stt-48-9.png b/src/icons/pratikabu-stt-48-9.png similarity index 100% rename from base/icons/pratikabu-stt-48-9.png rename to src/icons/pratikabu-stt-48-9.png diff --git a/base/icons/pratikabu-stt-bottom-16.png b/src/icons/pratikabu-stt-bottom-16.png similarity index 100% rename from base/icons/pratikabu-stt-bottom-16.png rename to src/icons/pratikabu-stt-bottom-16.png diff --git a/base/icons/pratikabu-stt-bottom-24.png b/src/icons/pratikabu-stt-bottom-24.png similarity index 100% rename from base/icons/pratikabu-stt-bottom-24.png rename to src/icons/pratikabu-stt-bottom-24.png diff --git a/base/icons/pratikabu-stt-clear-16.png b/src/icons/pratikabu-stt-clear-16.png similarity index 100% rename from base/icons/pratikabu-stt-clear-16.png rename to src/icons/pratikabu-stt-clear-16.png diff --git a/base/icons/pratikabu-stt-clear-24.png b/src/icons/pratikabu-stt-clear-24.png similarity index 100% rename from base/icons/pratikabu-stt-clear-24.png rename to src/icons/pratikabu-stt-clear-24.png diff --git a/base/icons/pratikabu-stt-dual-hr-1.png b/src/icons/pratikabu-stt-dual-hr-1.png similarity index 100% rename from base/icons/pratikabu-stt-dual-hr-1.png rename to src/icons/pratikabu-stt-dual-hr-1.png diff --git a/base/icons/pratikabu-stt-dual-hr-2.png b/src/icons/pratikabu-stt-dual-hr-2.png similarity index 100% rename from base/icons/pratikabu-stt-dual-hr-2.png rename to src/icons/pratikabu-stt-dual-hr-2.png diff --git a/base/icons/pratikabu-stt-dual-hr-3.png b/src/icons/pratikabu-stt-dual-hr-3.png similarity index 100% rename from base/icons/pratikabu-stt-dual-hr-3.png rename to src/icons/pratikabu-stt-dual-hr-3.png diff --git a/base/icons/pratikabu-stt-dual-hr-4.png b/src/icons/pratikabu-stt-dual-hr-4.png similarity index 100% rename from base/icons/pratikabu-stt-dual-hr-4.png rename to src/icons/pratikabu-stt-dual-hr-4.png diff --git a/base/icons/pratikabu-stt-dual-hr-5.png b/src/icons/pratikabu-stt-dual-hr-5.png similarity index 100% rename from base/icons/pratikabu-stt-dual-hr-5.png rename to src/icons/pratikabu-stt-dual-hr-5.png diff --git a/base/icons/pratikabu-stt-dual-hr-6.png b/src/icons/pratikabu-stt-dual-hr-6.png similarity index 100% rename from base/icons/pratikabu-stt-dual-hr-6.png rename to src/icons/pratikabu-stt-dual-hr-6.png diff --git a/base/icons/pratikabu-stt-dual-vr-1.png b/src/icons/pratikabu-stt-dual-vr-1.png similarity index 100% rename from base/icons/pratikabu-stt-dual-vr-1.png rename to src/icons/pratikabu-stt-dual-vr-1.png diff --git a/base/icons/pratikabu-stt-dual-vr-2.png b/src/icons/pratikabu-stt-dual-vr-2.png similarity index 100% rename from base/icons/pratikabu-stt-dual-vr-2.png rename to src/icons/pratikabu-stt-dual-vr-2.png diff --git a/base/icons/pratikabu-stt-dual-vr-3.png b/src/icons/pratikabu-stt-dual-vr-3.png similarity index 100% rename from base/icons/pratikabu-stt-dual-vr-3.png rename to src/icons/pratikabu-stt-dual-vr-3.png diff --git a/base/icons/pratikabu-stt-pageup-16.png b/src/icons/pratikabu-stt-pageup-16.png similarity index 100% rename from base/icons/pratikabu-stt-pageup-16.png rename to src/icons/pratikabu-stt-pageup-16.png diff --git a/base/icons/pratikabu-stt-pageup-24.png b/src/icons/pratikabu-stt-pageup-24.png similarity index 100% rename from base/icons/pratikabu-stt-pageup-24.png rename to src/icons/pratikabu-stt-pageup-24.png diff --git a/base/icons/pratikabu-stt-settings-16.png b/src/icons/pratikabu-stt-settings-16.png similarity index 100% rename from base/icons/pratikabu-stt-settings-16.png rename to src/icons/pratikabu-stt-settings-16.png diff --git a/base/icons/pratikabu-stt-settings-24.png b/src/icons/pratikabu-stt-settings-24.png similarity index 100% rename from base/icons/pratikabu-stt-settings-24.png rename to src/icons/pratikabu-stt-settings-24.png diff --git a/browserspecific/chrome/manifest.json b/src/manifest.json similarity index 94% rename from browserspecific/chrome/manifest.json rename to src/manifest.json index 4d6a8e1..1797344 100644 --- a/browserspecific/chrome/manifest.json +++ b/src/manifest.json @@ -21,7 +21,6 @@ "matches":[ "" ], "js":[ "thirdparty/pratikabu-jquery-3.2.1.min.js", - "browserspecific/pratikabu-stt-impl.js", "pratikabu-stt.js" ] } diff --git a/base/options/options.html b/src/options/options.html similarity index 99% rename from base/options/options.html rename to src/options/options.html index 8589039..6006fa4 100644 --- a/base/options/options.html +++ b/src/options/options.html @@ -8,7 +8,6 @@ - @@ -335,4 +334,4 @@ - \ No newline at end of file + diff --git a/base/options/res/options.css b/src/options/res/options.css similarity index 100% rename from base/options/res/options.css rename to src/options/res/options.css diff --git a/base/options/res/options.js b/src/options/res/options.js similarity index 94% rename from base/options/res/options.js rename to src/options/res/options.js index 1e91f6e..0d5e5a1 100644 --- a/base/options/res/options.js +++ b/src/options/res/options.js @@ -681,4 +681,56 @@ function getBase64Url(base64Url) { } return "data:image/png;base64," + base64Url; -} \ No newline at end of file +} + +/************************************************************ + Browser specific coding +************************************************************/ + +/** Saves options to localStorage. */ +function bsDefaultSettings() { + chrome.runtime.sendMessage({method: "resetSettings"}, function(status) { + if("success" === status) { + // Update status to let user know options were defaulted. + bsFetchSettings(post_restore_success); + + bsResetToolbarIcon(); + } + }); +} + +function bsInit() { +} + +function bsFetchSettings(methodToExecute) { + chrome.runtime.sendMessage({method: "fetchSettings"}, function(respSttData) { + restore_options(respSttData); + if(methodToExecute) + methodToExecute(); + }); +} + +function bsSaveSettings(data) { + chrome.runtime.sendMessage({method: "saveSettings", "sttData": data}, function(status) { + if("success" === status) { + // Update status to let user know options were saved. + post_save_success(); + } + }); +} + +$( document ).ready(function() { + psInitJavascriptFunctions(); +}); + +function getExtensionVersion() { + return chrome.runtime.getManifest().version; +} + +function bsResetToolbarIcon() { + chrome.runtime.sendMessage({method: "resetToolbarIcon"}); +} + +function bsResetContextMenu(showContextMenu) { + chrome.runtime.sendMessage({method: "resetContextMenu", showContextMenu: showContextMenu}); +} diff --git a/base/pratikabu-stt.css b/src/pratikabu-stt.css similarity index 100% rename from base/pratikabu-stt.css rename to src/pratikabu-stt.css diff --git a/base/pratikabu-stt.js b/src/pratikabu-stt.js similarity index 93% rename from base/pratikabu-stt.js rename to src/pratikabu-stt.js index 77cfd65..bd7a6c1 100644 --- a/base/pratikabu-stt.js +++ b/src/pratikabu-stt.js @@ -1,6 +1,52 @@ +/************************************************************ + Browser specific coding +************************************************************/ + +var pratikabustt_browser_impl = { + getFixedLocation : function() { + // #BrowserSpecific location + return "icons/pratikabu-stt-"; + }, + + fetchPreferences: function() { + chrome.runtime.sendMessage({method: "fetchSettings"}, function(response_msg) { + pratikabustt.loadFromResponse(response_msg); + }); + }, + + getBrowserSpecificUrl: function(imgUrl) { + // #BrowserSpecific method to get the resource + return chrome.runtime.getURL(imgUrl); + }, + + openOptionPage: function() { + // #BrowserSpecific method to open the option page + chrome.runtime.sendMessage({method: "openOptionPage"}); + }, + + setImageForId: function(imgId, imageName) { + var imgUrl = pratikabustt_browser_impl.getFixedLocation() + imageName; + $("#" + imgId).attr("src", pratikabustt_browser_impl.getBrowserSpecificUrl(imgUrl)); + }, + + /** + Remove all excess code required for + */ + removeCompleteAddOnCode: function() { + } +}; + +chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) { + if(request.pratikabusttaction == "top") + pratikabustt.scrollToTop(); + else if (request.pratikabusttaction == "intelligentflip") + pratikabustt.scrollIntelligently(); + else if(request.pratikabusttaction == "bottom") + pratikabustt.scrollToBottom(); +}); + /***************************************** -************** This file contains code which is browser independent **************** -************** Write browser dependent code in the specific browser dependent js file. ********* +************** Browser independent code starts here ********* ******************************************/ var pratikabu_stt_inversionPoint = 300;// inversion point where the inversion should happen var pratikabu_stt_bVisibility = false;// variable to check whether the button is already visible or hidden @@ -664,4 +710,5 @@ var pratikabustt = { Fetch preferences : #ENTRY POINT loadFromResponse() will be executed once the preferences have been fetched. */ -pratikabustt_browser_impl.fetchPreferences(); \ No newline at end of file +pratikabustt_browser_impl.fetchPreferences(); + diff --git a/base/thirdparty/pratikabu-jquery-3.2.1.min.js b/src/thirdparty/pratikabu-jquery-3.2.1.min.js similarity index 100% rename from base/thirdparty/pratikabu-jquery-3.2.1.min.js rename to src/thirdparty/pratikabu-jquery-3.2.1.min.js diff --git a/base/thirdparty/pratikabu-simple-slider.css b/src/thirdparty/pratikabu-simple-slider.css similarity index 100% rename from base/thirdparty/pratikabu-simple-slider.css rename to src/thirdparty/pratikabu-simple-slider.css diff --git a/base/thirdparty/pratikabu-simple-slider.js b/src/thirdparty/pratikabu-simple-slider.js similarity index 100% rename from base/thirdparty/pratikabu-simple-slider.js rename to src/thirdparty/pratikabu-simple-slider.js