Sha256: bf09ec0cbedd907af9a1c8cee34796326de74054e505f7c7ac66025e56403a8e

Contents?: true

Size: 1.5 KB

Versions: 19

Compression:

Stored size: 1.5 KB

Contents

/// Author Courtenay Probert
/// Version 1.1.1

$(function() {
	function editMe(cms) {
		var view = $(cms).attr("data-view");
        if(!view)
            alert("View missing");
            
		var page = $(cms).attr("data-page");
        if(!page)
            alert("Page missing");
            
        try{
            if(window.parentSandboxBridge !== undefined)
                window.parentSandboxBridge.editView(view, page);
            else
                alert("No Parent Sandbox Bridge");
        } catch (e) {
            alert(e);
        }
	}

	$("a[href^='http']")
		.attr('target','_blank')
		.click(function(e){
			e.preventDefault();
			href = $(this).attr("href");
			alert("Loading: "+ href);
			window.parentSandboxBridge.openExternalURL(href);
	});

	$(".cms").each(function(i) {
		var $this = $(this);
		$this.addClass("cmsEdit");
		var bgColor = $(this).css("background-color");

		var addTextMsg = "Double click to add text";
		$this
			.bind("dblclick", function(event) {
				event.stopPropagation();
				editMe(this);
			})
			.attr("title", "Double click to edit")
			.mouseover(function() {
				if ($.trim($this.html()) === "")
					$this.html(addTextMsg);
				$(this).css({
						backgroundColor: '#FFFFE0',
						cursor: 'pointer'
				});
			})
			.mouseout(function() {
				if ($.trim($this.html()) === addTextMsg)
					$this.html("");
				$this.css({
					backgroundColor: bgColor
				});
			});
	}).attr("style", "min-height: 25px;");
});

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
scms-4.5.1 assets/air-monkey-hook.js
scms-4.5.0 assets/air-monkey-hook.js
scms-4.4.9 assets/air-monkey-hook.js
scms-4.4.8 assets/air-monkey-hook.js
scms-4.4.6 assets/air-monkey-hook.js
scms-4.4.5 assets/air-monkey-hook.js
scms-4.4.4 assets/air-monkey-hook.js
scms-4.4.3 assets/air-monkey-hook.js
scms-4.4.2 assets/air-monkey-hook.js
scms-4.4.1 assets/air-monkey-hook.js
scms-4.4.0 assets/air-monkey-hook.js
scms-4.3.0 assets/air-monkey-hook.js
scms-4.2.6 assets/air-monkey-hook.js
scms-4.2.5 assets/air-monkey-hook.js
scms-4.2.4 assets/air-monkey-hook.js
scms-4.2.3 assets/air-monkey-hook.js
scms-4.2.2 assets/air-monkey-hook.js
scms-4.2.0 assets/air-monkey-hook.js
scms-4.1.2 assets/air-monkey-hook.js