Common.js
הערה: לאחר השמירה, ייתכן שיהיה צורך לנקות את זיכרון המטמון (cache) של הדפדפן כדי להבחין בשינויים.
- פיירפוקס / ספארי: להחזיק את המקש Shift בעת לחיצה על טעינה מחדש (Reload), או ללחוץ על צירוף המקשים Ctrl-F5 או Ctrl-R (במחשב מק: ⌘-R).
- גוגל כרום: ללחוץ על צירוף המקשים Ctrl-Shift-R (במחשב מק: ⌘-Shift-R).
- אינטרנט אקספלורר / אדג': להחזיק את המקש Ctrl בעת לחיצה על רענן (Refresh), או ללחוץ על צירוף המקשים Ctrl-F5.
- אופרה: ללחוץ על Ctrl-F5.
/* כל הסקריפטים שנכתבים כאן ייטענו עבור כל המשתמשים בכל טעינת עמוד. */
$(".thumbimage").attr({ webkitallowfullscreen:"", allowfullscreen:"" });
! function () {
/** get all the <img> width class thumbimage **/
var imgs = document.querySelectorAll(".thumbimage[src*='pdf']");
var s = imgs.length,
viewer = "/w/upload/ViewerJS/#../sheatufim", // replace in word thumb in url
http = ""; // http or ViewerJS
var pdf = /([\\\/\:\"\'\?\<\>\|\.])/g; //Regular expression that seeks to precede the special characters "\"
var refactor = /^.*\/thumb/, // Regular expression for everything before the word thumb in the url
aux = "",
src = "",
alt = "",
refa = "";
for (var i = 0; i < s; i++) {
alt = encodeURI( imgs[i].getAttribute("alt") ); //Get attribute alt
aux = new RegExp("pdf" + ".*");
src = imgs[i].src; //Get Src the img
src = src.replace(aux, "pdf"); // Deletes everything after the word in the alt attribute
src = src.replace(refactor, http + viewer); // Applies the regular expression refactor and concatenates http and viewer
imgs[i].src = src;
refa = imgs[i].outerHTML.replace(/(<|(?:<\/))img/g, "$1iframe"); //change img for iframe
imgs[i].outerHTML = refa; //
// iframe.setAttribute('allowFullScreen', 'webkitallowfullscreen');
}
}();