diff --git a/browser/app/profile/extensions/uriloader@pdf.js/bootstrap.js b/browser/app/profile/extensions/uriloader@pdf.js/bootstrap.js new file mode 100644 index 00000000000..d03812bcbbb --- /dev/null +++ b/browser/app/profile/extensions/uriloader@pdf.js/bootstrap.js @@ -0,0 +1,98 @@ +/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ + +'use strict'; + +const RESOURCE_NAME = 'pdf.js'; +const EXT_PREFIX = 'extensions.uriloader@pdf.js'; + +let Cc = Components.classes; +let Ci = Components.interfaces; +let Cm = Components.manager; +let Cu = Components.utils; +let application = Cc['@mozilla.org/fuel/application;1'] + .getService(Ci.fuelIApplication); + +Cu.import('resource://gre/modules/Services.jsm'); + +function log(str) { + if (!application.prefs.getValue(EXT_PREFIX + '.pdfBugEnabled', false)) + return; + dump(str + '\n'); +} + +// Register/unregister a class as a component. +let Factory = { + registrar: null, + aClass: null, + register: function(aClass) { + if (this.aClass) { + log('Cannot register more than one class'); + return; + } + this.registrar = Cm.QueryInterface(Ci.nsIComponentRegistrar); + this.aClass = aClass; + var proto = aClass.prototype; + this.registrar.registerFactory(proto.classID, proto.classDescription, + proto.contractID, this); + }, + unregister: function() { + if (!this.aClass) { + log('Class was never registered.'); + return; + } + var proto = this.aClass.prototype; + this.registrar.unregisterFactory(proto.classID, this); + this.aClass = null; + }, + // nsIFactory::createInstance + createInstance: function(outer, iid) { + if (outer !== null) + throw Cr.NS_ERROR_NO_AGGREGATION; + return (new (this.aClass)).QueryInterface(iid); + } +}; + +let pdfStreamConverterUrl = null; + +// As of Firefox 13 bootstrapped add-ons don't support automatic registering and +// unregistering of resource urls and components/contracts. Until then we do +// it programatically. See ManifestDirective ManifestParser.cpp for support. + +function startup(aData, aReason) { + // Setup the resource url. + var ioService = Services.io; + var resProt = ioService.getProtocolHandler('resource') + .QueryInterface(Ci.nsIResProtocolHandler); + var aliasURI = ioService.newURI('content/', 'UTF-8', aData.resourceURI); + resProt.setSubstitution(RESOURCE_NAME, aliasURI); + + // Load the component and register it. + pdfStreamConverterUrl = aData.resourceURI.spec + + 'components/PdfStreamConverter.js'; + Cu.import(pdfStreamConverterUrl); + Factory.register(PdfStreamConverter); +} + +function shutdown(aData, aReason) { + if (aReason == APP_SHUTDOWN) + return; + var ioService = Services.io; + var resProt = ioService.getProtocolHandler('resource') + .QueryInterface(Ci.nsIResProtocolHandler); + // Remove the resource url. + resProt.setSubstitution(RESOURCE_NAME, null); + // Remove the contract/component. + Factory.unregister(); + // Unload the converter + Cu.unload(pdfStreamConverterUrl); + pdfStreamConverterUrl = null; +} + +function install(aData, aReason) { +} + +function uninstall(aData, aReason) { + application.prefs.setValue(EXT_PREFIX + '.database', '{}'); +} + diff --git a/browser/app/profile/extensions/uriloader@pdf.js/content/web/debugger.js b/browser/app/profile/extensions/uriloader@pdf.js/content/web/debugger.js new file mode 100644 index 00000000000..00f5f6fd42d --- /dev/null +++ b/browser/app/profile/extensions/uriloader@pdf.js/content/web/debugger.js @@ -0,0 +1,475 @@ +/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ + +'use strict'; + +var FontInspector = (function FontInspectorClosure() { + var fonts; + var panelWidth = 300; + var active = false; + var fontAttribute = 'data-font-name'; + function removeSelection() { + var divs = document.querySelectorAll('div[' + fontAttribute + ']'); + for (var i = 0, ii = divs.length; i < ii; ++i) { + var div = divs[i]; + div.className = ''; + } + } + function resetSelection() { + var divs = document.querySelectorAll('div[' + fontAttribute + ']'); + for (var i = 0, ii = divs.length; i < ii; ++i) { + var div = divs[i]; + div.className = 'debuggerHideText'; + } + } + function selectFont(fontName, show) { + var divs = document.querySelectorAll('div[' + fontAttribute + '=' + + fontName + ']'); + for (var i = 0, ii = divs.length; i < ii; ++i) { + var div = divs[i]; + div.className = show ? 'debuggerShowText' : 'debuggerHideText'; + } + } + function textLayerClick(e) { + if (!e.target.dataset.fontName || e.target.tagName != 'DIV') + return; + var fontName = e.target.dataset.fontName; + var selects = document.getElementsByTagName('input'); + for (var i = 0; i < selects.length; ++i) { + var select = selects[i]; + if (select.dataset.fontName != fontName) continue; + select.checked = !select.checked; + selectFont(fontName, select.checked); + select.scrollIntoView(); + } + } + return { + // Poperties/functions needed by PDFBug. + id: 'FontInspector', + name: 'Font Inspector', + panel: null, + manager: null, + init: function init() { + var panel = this.panel; + panel.setAttribute('style', 'padding: 5px;'); + var tmp = document.createElement('button'); + tmp.addEventListener('click', resetSelection); + tmp.textContent = 'Refresh'; + panel.appendChild(tmp); + + fonts = document.createElement('div'); + panel.appendChild(fonts); + }, + enabled: false, + get active() { + return active; + }, + set active(value) { + active = value; + if (active) { + document.body.addEventListener('click', textLayerClick, true); + resetSelection(); + } else { + document.body.removeEventListener('click', textLayerClick, true); + removeSelection(); + } + }, + // FontInspector specific functions. + fontAdded: function fontAdded(fontObj, url) { + function properties(obj, list) { + var moreInfo = document.createElement('table'); + for (var i = 0; i < list.length; i++) { + var tr = document.createElement('tr'); + var td1 = document.createElement('td'); + td1.textContent = list[i]; + tr.appendChild(td1); + var td2 = document.createElement('td'); + td2.textContent = obj[list[i]].toString(); + tr.appendChild(td2); + moreInfo.appendChild(tr); + } + return moreInfo; + } + var moreInfo = properties(fontObj, ['name', 'type']); + var m = /url\(['"]?([^\)"']+)/.exec(url); + var fontName = fontObj.loadedName; + var font = document.createElement('div'); + var name = document.createElement('span'); + name.textContent = fontName; + var download = document.createElement('a'); + download.href = m[1]; + download.textContent = 'Download'; + var logIt = document.createElement('a'); + logIt.href = ''; + logIt.textContent = 'Log'; + logIt.addEventListener('click', function(event) { + event.preventDefault(); + console.log(fontObj); + }); + var select = document.createElement('input'); + select.setAttribute('type', 'checkbox'); + select.dataset.fontName = fontName; + select.addEventListener('click', (function(select, fontName) { + return (function() { + selectFont(fontName, select.checked); + }); + })(select, fontName)); + font.appendChild(select); + font.appendChild(name); + font.appendChild(document.createTextNode(' ')); + font.appendChild(download); + font.appendChild(document.createTextNode(' ')); + font.appendChild(logIt); + font.appendChild(moreInfo); + fonts.appendChild(font); + // Somewhat of a hack, should probably add a hook for when the text layer + // is done rendering. + setTimeout(function() { + if (this.active) + resetSelection(); + }.bind(this), 2000); + } + }; +})(); + +// Manages all the page steppers. +var StepperManager = (function StepperManagerClosure() { + var steppers = []; + var stepperDiv = null; + var stepperControls = null; + var stepperChooser = null; + var breakPoints = {}; + return { + // Poperties/functions needed by PDFBug. + id: 'Stepper', + name: 'Stepper', + panel: null, + manager: null, + init: function init() { + var self = this; + this.panel.setAttribute('style', 'padding: 5px;'); + stepperControls = document.createElement('div'); + stepperChooser = document.createElement('select'); + stepperChooser.addEventListener('change', function(event) { + self.selectStepper(this.value); + }); + stepperControls.appendChild(stepperChooser); + stepperDiv = document.createElement('div'); + this.panel.appendChild(stepperControls); + this.panel.appendChild(stepperDiv); + if (sessionStorage.getItem('pdfjsBreakPoints')) + breakPoints = JSON.parse(sessionStorage.getItem('pdfjsBreakPoints')); + }, + enabled: false, + active: false, + // Stepper specific functions. + create: function create(pageNumber) { + var debug = document.createElement('div'); + debug.id = 'stepper' + pageNumber; + debug.setAttribute('hidden', true); + debug.className = 'stepper'; + stepperDiv.appendChild(debug); + var b = document.createElement('option'); + b.textContent = 'Page ' + (pageNumber + 1); + b.value = pageNumber; + stepperChooser.appendChild(b); + var initBreakPoints = breakPoints[pageNumber] || []; + var stepper = new Stepper(debug, pageNumber, initBreakPoints); + steppers.push(stepper); + if (steppers.length === 1) + this.selectStepper(pageNumber, false); + return stepper; + }, + selectStepper: function selectStepper(pageNumber, selectPanel) { + if (selectPanel) + this.manager.selectPanel(1); + for (var i = 0; i < steppers.length; ++i) { + var stepper = steppers[i]; + if (stepper.pageNumber == pageNumber) + stepper.panel.removeAttribute('hidden'); + else + stepper.panel.setAttribute('hidden', true); + } + var options = stepperChooser.options; + for (var i = 0; i < options.length; ++i) { + var option = options[i]; + option.selected = option.value == pageNumber; + } + }, + saveBreakPoints: function saveBreakPoints(pageNumber, bps) { + breakPoints[pageNumber] = bps; + sessionStorage.setItem('pdfjsBreakPoints', JSON.stringify(breakPoints)); + } + }; +})(); + +// The stepper for each page's IRQueue. +var Stepper = (function StepperClosure() { + function Stepper(panel, pageNumber, initialBreakPoints) { + this.panel = panel; + this.len; + this.breakPoint = 0; + this.nextBreakPoint = null; + this.pageNumber = pageNumber; + this.breakPoints = initialBreakPoints; + this.currentIdx = -1; + } + Stepper.prototype = { + init: function init(IRQueue) { + // Shorter way to create element and optionally set textContent. + function c(tag, textContent) { + var d = document.createElement(tag); + if (textContent) + d.textContent = textContent; + return d; + } + var panel = this.panel; + this.len = IRQueue.fnArray.length; + var content = c('div', 'c=continue, s=step'); + var table = c('table'); + content.appendChild(table); + table.cellSpacing = 0; + var headerRow = c('tr'); + table.appendChild(headerRow); + headerRow.appendChild(c('th', 'Break')); + headerRow.appendChild(c('th', 'Idx')); + headerRow.appendChild(c('th', 'fn')); + headerRow.appendChild(c('th', 'args')); + + for (var i = 0; i < IRQueue.fnArray.length; i++) { + var line = c('tr'); + line.className = 'line'; + line.dataset.idx = i; + table.appendChild(line); + var checked = this.breakPoints.indexOf(i) != -1; + var args = IRQueue.argsArray[i] ? IRQueue.argsArray[i] : []; + + var breakCell = c('td'); + var cbox = c('input'); + cbox.type = 'checkbox'; + cbox.className = 'points'; + cbox.checked = checked; + var self = this; + cbox.onclick = (function(x) { + return function() { + if (this.checked) + self.breakPoints.push(x); + else + self.breakPoints.splice(self.breakPoints.indexOf(x), 1); + StepperManager.saveBreakPoints(self.pageNumber, self.breakPoints); + } + })(i); + + breakCell.appendChild(cbox); + line.appendChild(breakCell); + line.appendChild(c('td', i.toString())); + line.appendChild(c('td', IRQueue.fnArray[i])); + line.appendChild(c('td', args.join(', '))); + } + panel.appendChild(content); + var self = this; + }, + getNextBreakPoint: function getNextBreakPoint() { + this.breakPoints.sort(function(a, b) { return a - b; }); + for (var i = 0; i < this.breakPoints.length; i++) { + if (this.breakPoints[i] > this.currentIdx) + return this.breakPoints[i]; + } + return null; + }, + breakIt: function breakIt(idx, callback) { + StepperManager.selectStepper(this.pageNumber, true); + var self = this; + var dom = document; + self.currentIdx = idx; + var listener = function(e) { + switch (e.keyCode) { + case 83: // step + dom.removeEventListener('keydown', listener, false); + self.nextBreakPoint = self.currentIdx + 1; + self.goTo(-1); + callback(); + break; + case 67: // continue + dom.removeEventListener('keydown', listener, false); + var breakPoint = self.getNextBreakPoint(); + self.nextBreakPoint = breakPoint; + self.goTo(-1); + callback(); + break; + } + } + dom.addEventListener('keydown', listener, false); + self.goTo(idx); + }, + goTo: function goTo(idx) { + var allRows = this.panel.getElementsByClassName('line'); + for (var x = 0, xx = allRows.length; x < xx; ++x) { + var row = allRows[x]; + if (row.dataset.idx == idx) { + row.style.backgroundColor = 'rgb(251,250,207)'; + row.scrollIntoView(); + } else { + row.style.backgroundColor = null; + } + } + } + }; + return Stepper; +})(); + +var Stats = (function Stats() { + var stats = []; + function clear(node) { + while (node.hasChildNodes()) + node.removeChild(node.lastChild); + } + function getStatIndex(pageNumber) { + for (var i = 0, ii = stats.length; i < ii; ++i) + if (stats[i].pageNumber === pageNumber) + return i; + return false; + } + return { + // Poperties/functions needed by PDFBug. + id: 'Stats', + name: 'Stats', + panel: null, + manager: null, + init: function init() { + this.panel.setAttribute('style', 'padding: 5px;'); + PDFJS.enableStats = true; + }, + enabled: false, + active: false, + // Stats specific functions. + add: function(pageNumber, stat) { + if (!stat) + return; + var statsIndex = getStatIndex(pageNumber); + if (statsIndex !== false) { + var b = stats[statsIndex]; + this.panel.removeChild(b.div); + stats.splice(statsIndex, 1); + } + var wrapper = document.createElement('div'); + wrapper.className = 'stats'; + var title = document.createElement('div'); + title.className = 'title'; + title.textContent = 'Page: ' + pageNumber; + var statsDiv = document.createElement('div'); + statsDiv.textContent = stat.toString(); + wrapper.appendChild(title); + wrapper.appendChild(statsDiv); + stats.push({ pageNumber: pageNumber, div: wrapper }); + stats.sort(function(a, b) { return a.pageNumber - b.pageNumber}); + clear(this.panel); + for (var i = 0, ii = stats.length; i < ii; ++i) + this.panel.appendChild(stats[i].div); + } + }; +})(); + +// Manages all the debugging tools. +var PDFBug = (function PDFBugClosure() { + var panelWidth = 300; + var buttons = []; + var activePanel = null; + + return { + tools: [ + FontInspector, + StepperManager, + Stats + ], + enable: function(ids) { + var all = false, tools = this.tools; + if (ids.length === 1 && ids[0] === 'all') + all = true; + for (var i = 0; i < tools.length; ++i) { + var tool = tools[i]; + if (all || ids.indexOf(tool.id) !== -1) + tool.enabled = true; + } + if (!all) { + // Sort the tools by the order they are enabled. + tools.sort(function(a, b) { + var indexA = ids.indexOf(a.id); + indexA = indexA < 0 ? tools.length : indexA; + var indexB = ids.indexOf(b.id); + indexB = indexB < 0 ? tools.length : indexB; + return indexA - indexB; + }); + } + }, + init: function init() { + /* + * Basic Layout: + * PDFBug + * Controls + * Panels + * Panel + * Panel + * ... + */ + var ui = document.createElement('div'); + ui.id = 'PDFBug'; + + var controls = document.createElement('div'); + controls.setAttribute('class', 'controls'); + ui.appendChild(controls); + + var panels = document.createElement('div'); + panels.setAttribute('class', 'panels'); + ui.appendChild(panels); + + document.body.appendChild(ui); + document.body.style.paddingRight = panelWidth + 'px'; + + // Initialize all the debugging tools. + var tools = this.tools; + for (var i = 0; i < tools.length; ++i) { + var tool = tools[i]; + var panel = document.createElement('div'); + var panelButton = document.createElement('button'); + panelButton.textContent = tool.name; + var self = this; + panelButton.addEventListener('click', (function(selected) { + return function(event) { + event.preventDefault(); + self.selectPanel(selected); + }; + })(i)); + controls.appendChild(panelButton); + panels.appendChild(panel); + tool.panel = panel; + tool.manager = this; + if (tool.enabled) + tool.init(); + else + panel.textContent = tool.name + ' is disabled. To enable add ' + + ' "' + tool.id + '" to the pdfBug parameter ' + + 'and refresh (seperate multiple by commas).'; + buttons.push(panelButton); + } + this.selectPanel(0); + }, + selectPanel: function selectPanel(index) { + if (index === activePanel) + return; + activePanel = index; + var tools = this.tools; + for (var j = 0; j < tools.length; ++j) { + if (j == index) { + buttons[j].setAttribute('class', 'active'); + tools[j].active = true; + tools[j].panel.removeAttribute('hidden'); + } else { + buttons[j].setAttribute('class', ''); + tools[j].active = false; + tools[j].panel.setAttribute('hidden', 'true'); + } + } + } + }; +})(); diff --git a/browser/app/profile/extensions/uriloader@pdf.js/content/web/images/bookmark.svg b/browser/app/profile/extensions/uriloader@pdf.js/content/web/images/bookmark.svg new file mode 100644 index 00000000000..bee6efefdfb --- /dev/null +++ b/browser/app/profile/extensions/uriloader@pdf.js/content/web/images/bookmark.svg @@ -0,0 +1,662 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + New Bookmark + + + bookmark + remember + favorite + + + + + + Andreas Nilsson + + + + + + Jakub Steiner + + + create bookmark action + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/browser/app/profile/extensions/uriloader@pdf.js/content/web/images/check.svg b/browser/app/profile/extensions/uriloader@pdf.js/content/web/images/check.svg new file mode 100644 index 00000000000..e0e1590a937 --- /dev/null +++ b/browser/app/profile/extensions/uriloader@pdf.js/content/web/images/check.svg @@ -0,0 +1,3 @@ + + + diff --git a/browser/app/profile/extensions/uriloader@pdf.js/content/web/images/comment.svg b/browser/app/profile/extensions/uriloader@pdf.js/content/web/images/comment.svg new file mode 100644 index 00000000000..84feef1c89f --- /dev/null +++ b/browser/app/profile/extensions/uriloader@pdf.js/content/web/images/comment.svg @@ -0,0 +1,3 @@ + + + diff --git a/browser/app/profile/extensions/uriloader@pdf.js/content/web/images/document-print.svg b/browser/app/profile/extensions/uriloader@pdf.js/content/web/images/document-print.svg new file mode 100644 index 00000000000..4d062fbb69a --- /dev/null +++ b/browser/app/profile/extensions/uriloader@pdf.js/content/web/images/document-print.svg @@ -0,0 +1,533 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Print Document + + + Jakub Steiner + + + + http://jimmac.musichall.cz + + + document + lpr + print + local + laser + bubblejet + inkjet + print + output + cups + lpd + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/browser/app/profile/extensions/uriloader@pdf.js/content/web/images/download.svg b/browser/app/profile/extensions/uriloader@pdf.js/content/web/images/download.svg new file mode 100644 index 00000000000..884e3deed55 --- /dev/null +++ b/browser/app/profile/extensions/uriloader@pdf.js/content/web/images/download.svg @@ -0,0 +1,620 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Save + + + Jakub Steiner + + + + + hdd + hard drive + save + io + store + + + + + http://jimmac.musichall.cz + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/browser/app/profile/extensions/uriloader@pdf.js/content/web/images/go-down.svg b/browser/app/profile/extensions/uriloader@pdf.js/content/web/images/go-down.svg new file mode 100644 index 00000000000..655fdba16dc --- /dev/null +++ b/browser/app/profile/extensions/uriloader@pdf.js/content/web/images/go-down.svg @@ -0,0 +1,201 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + Jakub Steiner + + + http://jimmac.musichall.cz + + Go Down + + + go + lower + down + arrow + pointer + > + + + + + Andreas Nilsson + + + + + + + + + + + + + + + + + + + diff --git a/browser/app/profile/extensions/uriloader@pdf.js/content/web/images/go-up.svg b/browser/app/profile/extensions/uriloader@pdf.js/content/web/images/go-up.svg new file mode 100644 index 00000000000..5e2f9a2c645 --- /dev/null +++ b/browser/app/profile/extensions/uriloader@pdf.js/content/web/images/go-up.svg @@ -0,0 +1,197 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + Jakub Steiner + + + http://jimmac.musichall.cz + + Go Up + + + go + higher + up + arrow + pointer + > + + + + + Andreas Nilsson + + + + + + + + + + + + + + + + + diff --git a/browser/app/profile/extensions/uriloader@pdf.js/content/web/images/loading-icon.gif b/browser/app/profile/extensions/uriloader@pdf.js/content/web/images/loading-icon.gif new file mode 100644 index 00000000000..1c72ebb554b Binary files /dev/null and b/browser/app/profile/extensions/uriloader@pdf.js/content/web/images/loading-icon.gif differ diff --git a/browser/app/profile/extensions/uriloader@pdf.js/content/web/images/nav-outline.svg b/browser/app/profile/extensions/uriloader@pdf.js/content/web/images/nav-outline.svg new file mode 100644 index 00000000000..4d4323ce37e --- /dev/null +++ b/browser/app/profile/extensions/uriloader@pdf.js/content/web/images/nav-outline.svg @@ -0,0 +1,202 @@ + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/browser/app/profile/extensions/uriloader@pdf.js/content/web/images/nav-thumbs.svg b/browser/app/profile/extensions/uriloader@pdf.js/content/web/images/nav-thumbs.svg new file mode 100644 index 00000000000..8737b8cb633 --- /dev/null +++ b/browser/app/profile/extensions/uriloader@pdf.js/content/web/images/nav-thumbs.svg @@ -0,0 +1,283 @@ + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/browser/app/profile/extensions/uriloader@pdf.js/content/web/images/pin-down.svg b/browser/app/profile/extensions/uriloader@pdf.js/content/web/images/pin-down.svg new file mode 100644 index 00000000000..357667600b3 --- /dev/null +++ b/browser/app/profile/extensions/uriloader@pdf.js/content/web/images/pin-down.svg @@ -0,0 +1,297 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + diff --git a/browser/app/profile/extensions/uriloader@pdf.js/content/web/images/pin-up.svg b/browser/app/profile/extensions/uriloader@pdf.js/content/web/images/pin-up.svg new file mode 100644 index 00000000000..e55cec7a044 --- /dev/null +++ b/browser/app/profile/extensions/uriloader@pdf.js/content/web/images/pin-up.svg @@ -0,0 +1,230 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + diff --git a/browser/app/profile/extensions/uriloader@pdf.js/content/web/images/zoom-in.svg b/browser/app/profile/extensions/uriloader@pdf.js/content/web/images/zoom-in.svg new file mode 100644 index 00000000000..48ee42dd9b8 --- /dev/null +++ b/browser/app/profile/extensions/uriloader@pdf.js/content/web/images/zoom-in.svg @@ -0,0 +1,437 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Add + 2006-01-04 + + + Andreas Nilsson + + + http://tango-project.org + + + add + plus + + + + + + + + + + + + + + + + + + diff --git a/browser/app/profile/extensions/uriloader@pdf.js/content/web/images/zoom-out.svg b/browser/app/profile/extensions/uriloader@pdf.js/content/web/images/zoom-out.svg new file mode 100644 index 00000000000..eb13b60e376 --- /dev/null +++ b/browser/app/profile/extensions/uriloader@pdf.js/content/web/images/zoom-out.svg @@ -0,0 +1,425 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Remove + 2006-01-04 + + + Andreas Nilsson + + + http://tango-project.org + + + remove + delete + + + + + + + + + + + + + + + + + diff --git a/browser/app/profile/extensions/uriloader@pdf.js/extension-files b/browser/app/profile/extensions/uriloader@pdf.js/extension-files new file mode 100644 index 00000000000..7a2f77618b9 --- /dev/null +++ b/browser/app/profile/extensions/uriloader@pdf.js/extension-files @@ -0,0 +1,24 @@ +bootstrap.js +icon.png +icon64.png +components/PdfStreamConverter.js +content/web/debugger.js +content/web/images/bookmark.svg +content/web/images/check.svg +content/web/images/comment.svg +content/web/images/document-print.svg +content/web/images/download.svg +content/web/images/go-down.svg +content/web/images/go-up.svg +content/web/images/loading-icon.gif +content/web/images/nav-outline.svg +content/web/images/nav-thumbs.svg +content/web/images/pin-down.svg +content/web/images/pin-up.svg +content/web/images/zoom-in.svg +content/web/images/zoom-out.svg +content/web/viewer-snippet-firefox-extension.html +content/web/viewer.css +content/web/viewer.html +content/web/viewer.js +LICENSE diff --git a/browser/app/profile/extensions/uriloader@pdf.js/icon.png b/browser/app/profile/extensions/uriloader@pdf.js/icon.png new file mode 100644 index 00000000000..64763756eb6 Binary files /dev/null and b/browser/app/profile/extensions/uriloader@pdf.js/icon.png differ diff --git a/browser/app/profile/extensions/uriloader@pdf.js/icon64.png b/browser/app/profile/extensions/uriloader@pdf.js/icon64.png new file mode 100644 index 00000000000..0131bbb5c92 Binary files /dev/null and b/browser/app/profile/extensions/uriloader@pdf.js/icon64.png differ diff --git a/browser/app/profile/extensions/uriloader@pdf.js/test/Makefile.in b/browser/app/profile/extensions/uriloader@pdf.js/test/Makefile.in new file mode 100644 index 00000000000..b609ef8f4f2 --- /dev/null +++ b/browser/app/profile/extensions/uriloader@pdf.js/test/Makefile.in @@ -0,0 +1,20 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this file, +# You can obtain one at http://mozilla.org/MPL/2.0/. + +DEPTH = ../../../../../.. +topsrcdir = @top_srcdir@ +srcdir = @srcdir@ +VPATH = @srcdir@ +relativesrcdir = browser/app/profile/extensions/uriloader@pdf.js/test + +include $(DEPTH)/config/autoconf.mk +include $(topsrcdir)/config/rules.mk + +_BROWSER_TEST_FILES = \ + browser_pdfjs_main.js \ + file_pdfjs_test.pdf \ + $(NULL) + +libs:: $(_BROWSER_TEST_FILES) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir) diff --git a/browser/app/profile/extensions/uriloader@pdf.js/test/file_pdfjs_test.pdf b/browser/app/profile/extensions/uriloader@pdf.js/test/file_pdfjs_test.pdf new file mode 100644 index 00000000000..68d77cc5b6a Binary files /dev/null and b/browser/app/profile/extensions/uriloader@pdf.js/test/file_pdfjs_test.pdf differ diff --git a/testing/marionette/client/marionette/tests/unit/test_window_switching.py b/testing/marionette/client/marionette/tests/unit/test_window_switching.py deleted file mode 100644 index b6ca85c17c9..00000000000 --- a/testing/marionette/client/marionette/tests/unit/test_window_switching.py +++ /dev/null @@ -1,45 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this file, -# You can obtain one at http://mozilla.org/MPL/2.0/. - -import os -import time -from marionette_test import MarionetteTestCase - -class TestWindowSwitching(MarionetteTestCase): - def testJSWindowCreationAndSwitching(self): - test_html = self.marionette.absolute_url("test_windows.html") - self.marionette.navigate(test_html) - - current_window = self.marionette.get_window() - link = self.marionette.find_element("link text", "Open new window") - link.click() - - windows = self.marionette.get_windows() - windows.remove(current_window) - self.marionette.switch_to_window(windows[0]) - - title = self.marionette.execute_script("return document.title") - results_page = self.marionette.absolute_url("resultPage.html") - self.assertEqual(self.marionette.get_url(), results_page) - self.assertEqual(title, "We Arrive Here") - - #ensure navigate works in our current window - other_page = self.marionette.absolute_url("test.html") - self.marionette.navigate(other_page) - other_window = self.marionette.get_window() - - #try to access its dom - #since Bug 720714 stops us from checking DOMContentLoaded, we wait a bit - for i in range(30): - try: - self.marionette.find_element("id", "mozLink") - break - except: - pass - time.sleep(1) - - self.assertEqual(other_window, self.marionette.get_window()) - self.marionette.switch_to_window(current_window) - self.assertEqual(current_window, self.marionette.get_window()) - diff --git a/testing/marionette/client/marionette/tests/unit/unit-tests.ini b/testing/marionette/client/marionette/tests/unit/unit-tests.ini index c9ab71ac8c9..5f7b11b873d 100644 --- a/testing/marionette/client/marionette/tests/unit/unit-tests.ini +++ b/testing/marionette/client/marionette/tests/unit/unit-tests.ini @@ -28,7 +28,3 @@ b2g = false [test_window_management.py] b2g = false - -[test_window_switching.py] -b2g = false - diff --git a/testing/marionette/client/marionette/www/resultPage.html b/testing/marionette/client/marionette/www/resultPage.html deleted file mode 100644 index 75b80acc9b4..00000000000 --- a/testing/marionette/client/marionette/www/resultPage.html +++ /dev/null @@ -1,13 +0,0 @@ - - - We Arrive Here - - - - -
- -
- - - diff --git a/testing/marionette/client/marionette/www/test_windows.html b/testing/marionette/client/marionette/www/test_windows.html deleted file mode 100644 index 3afb61d4c91..00000000000 --- a/testing/marionette/client/marionette/www/test_windows.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - XHTML Test Page - - -

Open new window

- - -